more golint cleanup

This commit is contained in:
Roland Osborne 2022-07-29 14:39:39 -07:00
parent 89bd4d9361
commit 2ead9b931e
15 changed files with 19 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import (
"net/http"
)
//GetNodeConfig retreive current admin config
func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
// validate login

View File

@ -7,6 +7,7 @@ import (
"net/http"
)
//GetNodeStatus query if node admin token has been set
func GetNodeStatus(w http.ResponseWriter, r *http.Request) {
var config store.Config
err := store.DB.Where("config_id = ?", CNFConfigured).First(&config).Error

View File

@ -8,6 +8,7 @@ import (
"net/http"
)
//GetOpenMessage retrieve message to deliver to contact for connection
func GetOpenMessage(w http.ResponseWriter, r *http.Request) {
account, code, res := ParamAgentToken(r, true)

View File

@ -4,6 +4,7 @@ import (
"net/http"
)
//GetProfile retrieve public profile of account holder
func GetProfile(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, true)

View File

@ -8,6 +8,7 @@ import (
"time"
)
//GetProfileImage retreive profile image for account holder
func GetProfileImage(w http.ResponseWriter, r *http.Request) {
var data []byte

View File

@ -6,6 +6,7 @@ import (
"net/http"
)
//GetProfileMessage get data message for sending profile to federated node
func GetProfileMessage(w http.ResponseWriter, r *http.Request) {
var code int
var err error

View File

@ -7,6 +7,7 @@ import (
"os"
)
//RemoveAccount removes owners account
func RemoveAccount(w http.ResponseWriter, r *http.Request) {
account, err := AccountLogin(r)

View File

@ -8,6 +8,7 @@ import (
"net/http"
)
//RemoveArticle removes article from account
func RemoveArticle(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, false)

View File

@ -8,6 +8,7 @@ import (
"net/http"
)
//RemoveCard removes card from account
func RemoveCard(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, false)

View File

@ -8,6 +8,7 @@ import (
"net/http"
)
//RemoveChannel removes channel from account
func RemoveChannel(w http.ResponseWriter, r *http.Request) {
var err error
var code int

View File

@ -8,6 +8,7 @@ import (
"net/http"
)
//Removes channel topic created by invoker or under invokers channel
func RemoveChannelTopic(w http.ResponseWriter, r *http.Request) {
// scan parameters

View File

@ -8,6 +8,7 @@ import (
"net/http"
)
//RemoveChannelTopic removes topic asset if invoker created topic
func RemoveChannelTopicAsset(w http.ResponseWriter, r *http.Request) {
// scan parameters

View File

@ -8,6 +8,7 @@ import (
"net/http"
)
//RemoveChannelTopicTag removes tag from topic
func RemoveChannelTopicTag(w http.ResponseWriter, r *http.Request) {
// scan parameters
@ -60,10 +61,10 @@ func RemoveChannelTopicTag(w http.ResponseWriter, r *http.Request) {
}
// check permission
if tag.GUID != guid {
ErrResponse(w, http.StatusUnauthorized, errors.New("not creator of tag"))
return
}
if act.GUID != guid && topicSlot.Topic.GUID != guid {
ErrResponse(w, http.StatusUnauthorized, errors.New("not creator of topic or host"))
return
}
err = store.DB.Transaction(func(tx *gorm.DB) error {

View File

@ -8,6 +8,7 @@ import (
"net/http"
)
//RemoveGroup removes group from account
func RemoveGroup(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, true)

View File

@ -10,6 +10,7 @@ import (
"strconv"
)
//RemoveNodeAccount deletes account on behalf of admin
func RemoveNodeAccount(w http.ResponseWriter, r *http.Request) {
// get referenced account id