more golint cleanup

This commit is contained in:
Roland Osborne 2022-07-22 14:40:10 -07:00
parent 99a92a0534
commit 820cd39b68
3 changed files with 116 additions and 114 deletions

View File

@ -12,6 +12,7 @@ import (
"time" "time"
) )
//ReadDataMessage is a helper function to read signed protocol messages
func ReadDataMessage(msg *DataMessage, obj interface{}) (string, string, int64, error) { func ReadDataMessage(msg *DataMessage, obj interface{}) (string, string, int64, error) {
var data []byte var data []byte
@ -85,6 +86,7 @@ func ReadDataMessage(msg *DataMessage, obj interface{}) (string, string, int64,
return guid, signedData.MessageType, signedData.Timestamp, nil return guid, signedData.MessageType, signedData.Timestamp, nil
} }
//WriteDataMessage is a helper function to write signed protocol messages
func WriteDataMessage(privateKey string, publicKey string, keyType string, func WriteDataMessage(privateKey string, publicKey string, keyType string,
signType string, guid string, messageType string, obj interface{}) (*DataMessage, error) { signType string, guid string, messageType string, obj interface{}) (*DataMessage, error) {

View File

@ -12,10 +12,12 @@ import (
var notify = make(chan *store.Notification, APPNotifyBuffer) var notify = make(chan *store.Notification, APPNotifyBuffer)
var notifyExit = make(chan bool) var notifyExit = make(chan bool)
//ExitNotifications stop forwarding notifications
func ExitNotifications() { func ExitNotifications() {
notifyExit <- true notifyExit <- true
} }
//SendNotifications forward notifcations to contacts
func SendNotifications() { func SendNotifications() {
// queue all saved notifications // queue all saved notifications
@ -33,9 +35,9 @@ func SendNotifications() {
case notification := <-notify: case notification := <-notify:
node := getStrConfigValue(CNFDomain, "") node := getStrConfigValue(CNFDomain, "")
if notification.Node == node { if notification.Node == node {
SendLocalNotification(notification) sendLocalNotification(notification)
} else { } else {
SendRemoteNotification(notification) sendRemoteNotification(notification)
} }
if err := store.DB.Delete(&notification).Error; err != nil { if err := store.DB.Delete(&notification).Error; err != nil {
ErrMsg(err) ErrMsg(err)
@ -46,7 +48,7 @@ func SendNotifications() {
} }
} }
func SendLocalNotification(notification *store.Notification) { func sendLocalNotification(notification *store.Notification) {
// pull reference account // pull reference account
var card store.Card var card store.Card
@ -80,7 +82,7 @@ func SendLocalNotification(notification *store.Notification) {
} }
} }
func SendRemoteNotification(notification *store.Notification) { func sendRemoteNotification(notification *store.Notification) {
var module string var module string
if notification.Module == APPNotifyProfile { if notification.Module == APPNotifyProfile {
@ -118,7 +120,7 @@ func SendRemoteNotification(notification *store.Notification) {
} }
} }
// notify all cards of profile change //SetProfileNotification notifies all connected contacts of profile changes
func SetProfileNotification(account *store.Account) { func SetProfileNotification(account *store.Account) {
// select all connected cards // select all connected cards
@ -150,6 +152,7 @@ func SetProfileNotification(account *store.Account) {
} }
} }
//SetContactArticleNotification notifies all connected contacts of article changes
// notify single card of article change: // notify single card of article change:
// for each card of groups in updated article data // for each card of groups in updated article data
// for each card of group set or cleared from article (does not update data) // for each card of group set or cleared from article (does not update data)
@ -175,6 +178,7 @@ func SetContactArticleNotification(account *store.Account, card *store.Card) {
} }
} }
//SetContactViewNotification notifies all connected contacts of view change
// notify single card of view change: // notify single card of view change:
// card set or cleared from a group // card set or cleared from a group
// for each card in deleted group // for each card in deleted group
@ -200,6 +204,7 @@ func SetContactViewNotification(account *store.Account, card *store.Card) {
} }
} }
//SetContactChannelNotification notifies all connected contacts of channel changes
// notify single card of channel change: // notify single card of channel change:
// for each card in updated channel data // for each card in updated channel data
func SetContactChannelNotification(account *store.Account, card *store.Card) { func SetContactChannelNotification(account *store.Account, card *store.Card) {

View File

@ -1,28 +1,27 @@
package databag package databag
import ( import (
"fmt"
"net/http" "net/http"
"strings" "strings"
"github.com/gorilla/mux" "github.com/gorilla/mux"
) )
type Route struct { type route struct {
Name string Name string
Method string Method string
Pattern string Pattern string
HandlerFunc http.HandlerFunc HandlerFunc http.HandlerFunc
} }
type Routes []Route type routes []route
//NewRouter allocate router for databag API
func NewRouter() *mux.Router { func NewRouter() *mux.Router {
go SendNotifications() go SendNotifications()
router := mux.NewRouter().StrictSlash(true) router := mux.NewRouter().StrictSlash(true)
for _, route := range routes { for _, route := range endpoints {
var handler http.Handler var handler http.Handler
handler = route.HandlerFunc handler = route.HandlerFunc
handler = Logger(handler, route.Name) handler = Logger(handler, route.Name)
@ -40,699 +39,695 @@ func NewRouter() *mux.Router {
return router return router
} }
func Index(w http.ResponseWriter, r *http.Request) { var endpoints = routes{
fmt.Fprintf(w, "Hello World!")
}
var routes = Routes{ route{
Route{
"AddAccount", "AddAccount",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/account/profile", "/account/profile",
AddAccount, AddAccount,
}, },
Route{ route{
"AddAccountApp", "AddAccountApp",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/account/apps", "/account/apps",
AddAccountApp, AddAccountApp,
}, },
Route{ route{
"AddAccountAuthentication", "AddAccountAuthentication",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/account/auth", "/account/auth",
AddAccountAuthentication, AddAccountAuthentication,
}, },
Route{ route{
"GetAccountApps", "GetAccountApps",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/apps", "/account/apps",
GetAccountApps, GetAccountApps,
}, },
Route{ route{
"GetAccountAsset", "GetAccountAsset",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/assets/{assetID}", "/account/assets/{assetID}",
GetAccountAsset, GetAccountAsset,
}, },
Route{ route{
"GetAccountListing", "GetAccountListing",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/listing", "/account/listing",
GetAccountListing, GetAccountListing,
}, },
Route{ route{
"GetAccountListingImage", "GetAccountListingImage",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/listing/{guid}/image", "/account/listing/{guid}/image",
GetAccountListingImage, GetAccountListingImage,
}, },
Route{ route{
"GetAccountListingMessage", "GetAccountListingMessage",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/listing/{guid}/message", "/account/listing/{guid}/message",
GetAccountListingMessage, GetAccountListingMessage,
}, },
Route{ route{
"GetAccountStatus", "GetAccountStatus",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/status", "/account/status",
GetAccountStatus, GetAccountStatus,
}, },
Route{ route{
"GetAccountToken", "GetAccountToken",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/token", "/account/token",
GetAccountToken, GetAccountToken,
}, },
Route{ route{
"GetAccountAvailable", "GetAccountAvailable",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/available", "/account/available",
GetAccountAvailable, GetAccountAvailable,
}, },
Route{ route{
"GetAccountUsername", "GetAccountUsername",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/username", "/account/username",
GetAccountUsername, GetAccountUsername,
}, },
Route{ route{
"RemoveAccount", "RemoveAccount",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/account/profile", "/account/profile",
RemoveAccount, RemoveAccount,
}, },
Route{ route{
"RemoveAccountApp", "RemoveAccountApp",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/account/apps/{appID}", "/account/apps/{appID}",
RemoveAccountApp, RemoveAccountApp,
}, },
Route{ route{
"SetAccountAccess", "SetAccountAccess",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/account/access", "/account/access",
SetAccountAccess, SetAccountAccess,
}, },
Route{ route{
"SetAccountAuthentication", "SetAccountAuthentication",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/account/auth", "/account/auth",
SetAccountAuthentication, SetAccountAuthentication,
}, },
Route{ route{
"SetAccountExport", "SetAccountExport",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/account/export", "/account/export",
SetAccountExport, SetAccountExport,
}, },
Route{ route{
"SetAccountNode", "SetAccountNode",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/account/node", "/account/node",
SetAccountNode, SetAccountNode,
}, },
Route{ route{
"SetAccountLogin", "SetAccountLogin",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/account/login", "/account/login",
SetAccountLogin, SetAccountLogin,
}, },
Route{ route{
"SetAccountSerchable", "SetAccountSerchable",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/account/searchable", "/account/searchable",
SetAccountSearchable, SetAccountSearchable,
}, },
Route{ route{
"AddNodeAccount", "AddNodeAccount",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/admin/accounts", "/admin/accounts",
AddNodeAccount, AddNodeAccount,
}, },
Route{ route{
"GetNodeAccountImage", "GetNodeAccountImage",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/admin/accounts/{accountID}/image", "/admin/accounts/{accountID}/image",
GetNodeAccountImage, GetNodeAccountImage,
}, },
Route{ route{
"SetNodeAccountStatus", "SetNodeAccountStatus",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/admin/accounts/{accountID}/status", "/admin/accounts/{accountID}/status",
SetNodeAccountStatus, SetNodeAccountStatus,
}, },
Route{ route{
"AddNodeAccountAccess", "AddNodeAccountAccess",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/admin/accounts/{accountID}/auth", "/admin/accounts/{accountID}/auth",
AddNodeAccountAccess, AddNodeAccountAccess,
}, },
Route{ route{
"GetNodeAccounts", "GetNodeAccounts",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/admin/accounts", "/admin/accounts",
GetNodeAccounts, GetNodeAccounts,
}, },
Route{ route{
"GetNodeConfig", "GetNodeConfig",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/admin/config", "/admin/config",
GetNodeConfig, GetNodeConfig,
}, },
Route{ route{
"GetNodeStatus", "GetNodeStatus",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/admin/status", "/admin/status",
GetNodeStatus, GetNodeStatus,
}, },
Route{ route{
"ImportAccount", "ImportAccount",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/admin/accounts/import", "/admin/accounts/import",
ImportAccount, ImportAccount,
}, },
Route{ route{
"RemoveNodeAccount", "RemoveNodeAccount",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/admin/accounts/{accountID}", "/admin/accounts/{accountID}",
RemoveNodeAccount, RemoveNodeAccount,
}, },
Route{ route{
"SetNodeAccount", "SetNodeAccount",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/admin/accounts/{accountID}/reset", "/admin/accounts/{accountID}/reset",
SetNodeAccount, SetNodeAccount,
}, },
Route{ route{
"SetNodeConfig", "SetNodeConfig",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/admin/config", "/admin/config",
SetNodeConfig, SetNodeConfig,
}, },
Route{ route{
"SetNodeStatus", "SetNodeStatus",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/admin/status", "/admin/status",
SetNodeStatus, SetNodeStatus,
}, },
Route{ route{
"AddGroup", "AddGroup",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/alias/groups", "/alias/groups",
AddGroup, AddGroup,
}, },
Route{ route{
"GetGroupSubjectField", "GetGroupSubjectField",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/alias/groups/{groupID}/subject/{field}", "/alias/groups/{groupID}/subject/{field}",
GetGroupSubjectField, GetGroupSubjectField,
}, },
Route{ route{
"GetGroups", "GetGroups",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/alias/groups", "/alias/groups",
GetGroups, GetGroups,
}, },
Route{ route{
"RemoveGroup", "RemoveGroup",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/alias/groups/{groupID}", "/alias/groups/{groupID}",
RemoveGroup, RemoveGroup,
}, },
Route{ route{
"SetGroupSubject", "SetGroupSubject",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/alias/groups/{groupID}/subject", "/alias/groups/{groupID}/subject",
SetGroupSubject, SetGroupSubject,
}, },
Route{ route{
"AddArticle", "AddArticle",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/attribute/articles", "/attribute/articles",
AddArticle, AddArticle,
}, },
Route{ route{
"ClearArticleGroup", "ClearArticleGroup",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/attribute/articles/{articleID}/groups/{groupID}", "/attribute/articles/{articleID}/groups/{groupID}",
ClearArticleGroup, ClearArticleGroup,
}, },
Route{ route{
"GetArticleSubjectField", "GetArticleSubjectField",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/attribute/articles/{articleID}/subject/{field}", "/attribute/articles/{articleID}/subject/{field}",
GetArticleSubjectField, GetArticleSubjectField,
}, },
Route{ route{
"GetArticles", "GetArticles",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/attribute/articles", "/attribute/articles",
GetArticles, GetArticles,
}, },
Route{ route{
"RemoveArticle", "RemoveArticle",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/attribute/articles/{articleID}", "/attribute/articles/{articleID}",
RemoveArticle, RemoveArticle,
}, },
Route{ route{
"SetArticleGroup", "SetArticleGroup",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/attribute/articles/{articleID}/groups/{groupID}", "/attribute/articles/{articleID}/groups/{groupID}",
SetArticleGroup, SetArticleGroup,
}, },
Route{ route{
"SetArticleSubject", "SetArticleSubject",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/attribute/articles/{articleID}/subject", "/attribute/articles/{articleID}/subject",
SetArticleSubject, SetArticleSubject,
}, },
Route{ route{
"Authorize", "Authorize",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/authorize", "/authorize",
Authorize, Authorize,
}, },
Route{ route{
"AddCard", "AddCard",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/contact/cards", "/contact/cards",
AddCard, AddCard,
}, },
Route{ route{
"ClearCardGroup", "ClearCardGroup",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/contact/cards/{cardID}/groups/{groupID}", "/contact/cards/{cardID}/groups/{groupID}",
ClearCardGroup, ClearCardGroup,
}, },
Route{ route{
"ClearCardNotes", "ClearCardNotes",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/contact/cards/{cardID}/notes", "/contact/cards/{cardID}/notes",
ClearCardNotes, ClearCardNotes,
}, },
Route{ route{
"GetCardDetail", "GetCardDetail",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/contact/cards/{cardID}/detail", "/contact/cards/{cardID}/detail",
GetCardDetail, GetCardDetail,
}, },
Route{ route{
"GetCardProfile", "GetCardProfile",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/contact/cards/{cardID}/profile", "/contact/cards/{cardID}/profile",
GetCardProfile, GetCardProfile,
}, },
Route{ route{
"GetCardProfileImage", "GetCardProfileImage",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/contact/cards/{cardID}/profile/image", "/contact/cards/{cardID}/profile/image",
GetCardProfileImage, GetCardProfileImage,
}, },
Route{ route{
"GetCards", "GetCards",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/contact/cards", "/contact/cards",
GetCards, GetCards,
}, },
Route{ route{
"GetCloseMessage", "GetCloseMessage",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/contact/cards/{cardID}/closeMessage", "/contact/cards/{cardID}/closeMessage",
GetCloseMessage, GetCloseMessage,
}, },
Route{ route{
"GetOpenMessage", "GetOpenMessage",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/contact/cards/{cardID}/openMessage", "/contact/cards/{cardID}/openMessage",
GetOpenMessage, GetOpenMessage,
}, },
Route{ route{
"RemoveCard", "RemoveCard",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/contact/cards/{cardID}", "/contact/cards/{cardID}",
RemoveCard, RemoveCard,
}, },
Route{ route{
"SetArticleRevision", "SetArticleRevision",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/article/revision", "/contact/article/revision",
SetArticleRevision, SetArticleRevision,
}, },
Route{ route{
"SetCardGroup", "SetCardGroup",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/cards/{cardID}/groups/{groupID}", "/contact/cards/{cardID}/groups/{groupID}",
SetCardGroup, SetCardGroup,
}, },
Route{ route{
"SetCardNotes", "SetCardNotes",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/cards/{cardID}/notes", "/contact/cards/{cardID}/notes",
SetCardNotes, SetCardNotes,
}, },
Route{ route{
"SetCardProfile", "SetCardProfile",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/cards/{cardID}/profile", "/contact/cards/{cardID}/profile",
SetCardProfile, SetCardProfile,
}, },
Route{ route{
"SetCardStatus", "SetCardStatus",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/cards/{cardID}/status", "/contact/cards/{cardID}/status",
SetCardStatus, SetCardStatus,
}, },
Route{ route{
"SetChannelRevision", "SetChannelRevision",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/channel/revision", "/contact/channel/revision",
SetChannelRevision, SetChannelRevision,
}, },
Route{ route{
"SetCloseMessage", "SetCloseMessage",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/closeMessage", "/contact/closeMessage",
SetCloseMessage, SetCloseMessage,
}, },
Route{ route{
"SetOpenMessage", "SetOpenMessage",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/openMessage", "/contact/openMessage",
SetOpenMessage, SetOpenMessage,
}, },
Route{ route{
"SetProfileRevision", "SetProfileRevision",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/profile/revision", "/contact/profile/revision",
SetProfileRevision, SetProfileRevision,
}, },
Route{ route{
"SetViewRevision", "SetViewRevision",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/contact/view/revision", "/contact/view/revision",
SetViewRevision, SetViewRevision,
}, },
Route{ route{
"AddChannel", "AddChannel",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/content/channels", "/content/channels",
AddChannel, AddChannel,
}, },
Route{ route{
"AddChannelTopicAsset", "AddChannelTopicAsset",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/content/channels/{channelID}/topics/{topicID}/assets", "/content/channels/{channelID}/topics/{topicID}/assets",
AddChannelTopicAsset, AddChannelTopicAsset,
}, },
Route{ route{
"AddChannelTopic", "AddChannelTopic",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/content/channels/{channelID}/topics", "/content/channels/{channelID}/topics",
AddChannelTopic, AddChannelTopic,
}, },
Route{ route{
"AddChannelTopicTag", "AddChannelTopicTag",
strings.ToUpper("Post"), strings.ToUpper("Post"),
"/content/channels/{channelID}/topics/{topicID}/tags", "/content/channels/{channelID}/topics/{topicID}/tags",
AddChannelTopicTag, AddChannelTopicTag,
}, },
Route{ route{
"ClearChannelCard", "ClearChannelCard",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/content/channels/{channelID}/cards/{cardID}", "/content/channels/{channelID}/cards/{cardID}",
ClearChannelCard, ClearChannelCard,
}, },
Route{ route{
"ClearChannelGroup", "ClearChannelGroup",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/content/channels/{channelID}/groups/{groupID}", "/content/channels/{channelID}/groups/{groupID}",
ClearChannelGroup, ClearChannelGroup,
}, },
Route{ route{
"GetChannelTopicAsset", "GetChannelTopicAsset",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/topics/{topicID}/assets/{assetID}", "/content/channels/{channelID}/topics/{topicID}/assets/{assetID}",
GetChannelTopicAsset, GetChannelTopicAsset,
}, },
Route{ route{
"GetChannelTopicAssets", "GetChannelTopicAssets",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/topics/{topicID}/assets", "/content/channels/{channelID}/topics/{topicID}/assets",
GetChannelTopicAssets, GetChannelTopicAssets,
}, },
Route{ route{
"GetChannelDetail", "GetChannelDetail",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/detail", "/content/channels/{channelID}/detail",
GetChannelDetail, GetChannelDetail,
}, },
Route{ route{
"GetChannelSummary", "GetChannelSummary",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/summary", "/content/channels/{channelID}/summary",
GetChannelSummary, GetChannelSummary,
}, },
Route{ route{
"GetChannelSubjectField", "GetChannelSubjectField",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/subject/{field}", "/content/channels/{channelID}/subject/{field}",
GetChannelSubjectField, GetChannelSubjectField,
}, },
Route{ route{
"GetChannelTopic", "GetChannelTopic",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/topics/{topicID}/detail", "/content/channels/{channelID}/topics/{topicID}/detail",
GetChannelTopic, GetChannelTopic,
}, },
Route{ route{
"GetChannelTopicDetail", "GetChannelTopicDetail",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/topics/{topicID}/detail", "/content/channels/{channelID}/topics/{topicID}/detail",
GetChannelTopicDetail, GetChannelTopicDetail,
}, },
Route{ route{
"GetChannelTopicSubjectField", "GetChannelTopicSubjectField",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/topics/{topicID}/subject/{field}", "/content/channels/{channelID}/topics/{topicID}/subject/{field}",
GetChannelTopicSubjectField, GetChannelTopicSubjectField,
}, },
Route{ route{
"GetChannelTopicTagSubjectField", "GetChannelTopicTagSubjectField",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/topics/{topicID}/tags/{tagID}/subject/{field}", "/content/channels/{channelID}/topics/{topicID}/tags/{tagID}/subject/{field}",
GetChannelTopicTagSubjectField, GetChannelTopicTagSubjectField,
}, },
Route{ route{
"GetChannelTopicTags", "GetChannelTopicTags",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/topics/{topicID}/tags", "/content/channels/{channelID}/topics/{topicID}/tags",
GetChannelTopicTags, GetChannelTopicTags,
}, },
Route{ route{
"GetChannelTopics", "GetChannelTopics",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels/{channelID}/topics", "/content/channels/{channelID}/topics",
GetChannelTopics, GetChannelTopics,
}, },
Route{ route{
"GetChannels", "GetChannels",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/content/channels", "/content/channels",
GetChannels, GetChannels,
}, },
Route{ route{
"RemoveChannel", "RemoveChannel",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/content/channels/{channelID}", "/content/channels/{channelID}",
RemoveChannel, RemoveChannel,
}, },
Route{ route{
"RemoveChannelTopicAsset", "RemoveChannelTopicAsset",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/content/channels/{channelID}/topics/{topicID}/assets/{assetID}", "/content/channels/{channelID}/topics/{topicID}/assets/{assetID}",
RemoveChannelTopicAsset, RemoveChannelTopicAsset,
}, },
Route{ route{
"RemoveChannelTopic", "RemoveChannelTopic",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/content/channels/{channelID}/topics/{topicID}", "/content/channels/{channelID}/topics/{topicID}",
RemoveChannelTopic, RemoveChannelTopic,
}, },
Route{ route{
"RemoveChannelTopicTag", "RemoveChannelTopicTag",
strings.ToUpper("Delete"), strings.ToUpper("Delete"),
"/content/channels/{channelID}/topics/{topicID}/tags/{tagID}", "/content/channels/{channelID}/topics/{topicID}/tags/{tagID}",
RemoveChannelTopicTag, RemoveChannelTopicTag,
}, },
Route{ route{
"SetChannelCard", "SetChannelCard",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/content/channels/{channelID}/cards/{cardID}", "/content/channels/{channelID}/cards/{cardID}",
SetChannelCard, SetChannelCard,
}, },
Route{ route{
"SetChannelTopicConfirmed", "SetChannelTopicConfirmed",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/content/channels/{channelID}/topics/{topicID}/confirmed", "/content/channels/{channelID}/topics/{topicID}/confirmed",
SetChannelTopicConfirmed, SetChannelTopicConfirmed,
}, },
Route{ route{
"SetChannelGroup", "SetChannelGroup",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/content/channels/{channelID}/groups/{groupID}", "/content/channels/{channelID}/groups/{groupID}",
SetChannelGroup, SetChannelGroup,
}, },
Route{ route{
"SetChannelSubject", "SetChannelSubject",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/content/channels/{channelID}/subject", "/content/channels/{channelID}/subject",
SetChannelSubject, SetChannelSubject,
}, },
Route{ route{
"SetChannelTopicSubject", "SetChannelTopicSubject",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/content/channels/{channelID}/topics/{topicID}/subject", "/content/channels/{channelID}/topics/{topicID}/subject",
SetChannelTopicSubject, SetChannelTopicSubject,
}, },
Route{ route{
"SetChannelTopicTagSubject", "SetChannelTopicTagSubject",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/content/channels/{channelID}/topics/{topicID}/tags/{tagID}/subject", "/content/channels/{channelID}/topics/{topicID}/tags/{tagID}/subject",
SetChannelTopicTagSubject, SetChannelTopicTagSubject,
}, },
Route{ route{
"GetProfile", "GetProfile",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/profile", "/profile",
GetProfile, GetProfile,
}, },
Route{ route{
"GetProfileImage", "GetProfileImage",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/profile/image", "/profile/image",
GetProfileImage, GetProfileImage,
}, },
Route{ route{
"GetProfileMessage", "GetProfileMessage",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/profile/message", "/profile/message",
GetProfileMessage, GetProfileMessage,
}, },
Route{ route{
"SetProfile", "SetProfile",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/profile/data", "/profile/data",
SetProfile, SetProfile,
}, },
Route{ route{
"SetProfileImage", "SetProfileImage",
strings.ToUpper("Put"), strings.ToUpper("Put"),
"/profile/image", "/profile/image",
SetProfileImage, SetProfileImage,
}, },
Route{ route{
"Status", "Status",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/status", "/status",