more golint cleanup

This commit is contained in:
Roland Osborne 2022-07-25 11:44:33 -07:00
parent 18616539d3
commit 118404c77f
10 changed files with 12 additions and 3 deletions

View File

@ -16,7 +16,7 @@ func GetAccountAsset(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
} }
//RemoveAccount TODO remove app attached to account //RemoveAccountApp TODO remove app attached to account
func RemoveAccountApp(w http.ResponseWriter, r *http.Request) { func RemoveAccountApp(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.Header().Set("Content-Type", "application/json; charset=UTF-8")
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)

View File

@ -7,6 +7,7 @@ import (
"net/http" "net/http"
) )
//AddArticle add a new article for account specified by agent query param
func AddArticle(w http.ResponseWriter, r *http.Request) { func AddArticle(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, false) account, code, err := ParamAgentToken(r, false)

View File

@ -10,6 +10,7 @@ import (
"net/http" "net/http"
) )
//AddCard adds contact to account specified by agent query param
func AddCard(w http.ResponseWriter, r *http.Request) { func AddCard(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, false) account, code, err := ParamAgentToken(r, false)

View File

@ -7,6 +7,7 @@ import (
"net/http" "net/http"
) )
//AddChannel adds a channel to account specified by qgent query param
func AddChannel(w http.ResponseWriter, r *http.Request) { func AddChannel(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, false) account, code, err := ParamAgentToken(r, false)

View File

@ -7,6 +7,7 @@ import (
"net/http" "net/http"
) )
//AddChannelTopic adds a topic to a channel through either contact or agent query param
func AddChannelTopic(w http.ResponseWriter, r *http.Request) { func AddChannelTopic(w http.ResponseWriter, r *http.Request) {
confirm := r.FormValue("confirm") confirm := r.FormValue("confirm")

View File

@ -14,6 +14,7 @@ import (
"strings" "strings"
) )
//AddChannelTopicAsset adds an asset to a topic and queues it for appropriate transform
func AddChannelTopicAsset(w http.ResponseWriter, r *http.Request) { func AddChannelTopicAsset(w http.ResponseWriter, r *http.Request) {
// scan parameters // scan parameters
@ -82,7 +83,7 @@ func AddChannelTopicAsset(w http.ResponseWriter, r *http.Request) {
return return
} }
defer file.Close() defer file.Close()
crc, size, err := SaveAsset(file, path) crc, size, err := saveAsset(file, path)
if err != nil { if err != nil {
ErrResponse(w, http.StatusInternalServerError, err) ErrResponse(w, http.StatusInternalServerError, err)
return return
@ -193,7 +194,7 @@ func isStorageFull(act *store.Account) (full bool, err error) {
return return
} }
func SaveAsset(src io.Reader, path string) (crc uint32, size int64, err error) { func saveAsset(src io.Reader, path string) (crc uint32, size int64, err error) {
output, res := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0666) output, res := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0666)
if res != nil { if res != nil {

View File

@ -9,6 +9,7 @@ import (
"net/http" "net/http"
) )
//AddChannelTopicTag adds a tag to a specified topic
func AddChannelTopicTag(w http.ResponseWriter, r *http.Request) { func AddChannelTopicTag(w http.ResponseWriter, r *http.Request) {
// scan parameters // scan parameters

View File

@ -7,6 +7,7 @@ import (
"net/http" "net/http"
) )
//AddGroup adds a group to account identified by agent query param
func AddGroup(w http.ResponseWriter, r *http.Request) { func AddGroup(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, true) account, code, err := ParamAgentToken(r, true)

View File

@ -8,6 +8,7 @@ import (
"time" "time"
) )
//AddNodeAccount generate a new token to be used for account creation
func AddNodeAccount(w http.ResponseWriter, r *http.Request) { func AddNodeAccount(w http.ResponseWriter, r *http.Request) {
if code, err := ParamAdminToken(r); err != nil { if code, err := ParamAdminToken(r); err != nil {

View File

@ -10,6 +10,7 @@ import (
"time" "time"
) )
//AddNodeAccountAccess generate a new token to be use for account login reset
func AddNodeAccountAccess(w http.ResponseWriter, r *http.Request) { func AddNodeAccountAccess(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r) params := mux.Vars(r)