mirror of
https://github.com/balzack/databag.git
synced 2025-04-22 01:25:17 +00:00
more golint cleanup
This commit is contained in:
parent
89bd4d9361
commit
2ead9b931e
@ -4,6 +4,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//GetNodeConfig retreive current admin config
|
||||
func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// validate login
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
//GetProfileImage retreive profile image for account holder
|
||||
func GetProfileImage(w http.ResponseWriter, r *http.Request) {
|
||||
var data []byte
|
||||
|
||||
|
@ -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
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
//RemoveAccount removes owners account
|
||||
func RemoveAccount(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
account, err := AccountLogin(r)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user