Documentation ¶
Index ¶
- func AskLoginRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func CallbackRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func EditSoundPostRoute(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func EditSoundRoute(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func GetDiscordSession(token string) *discordgo.Session
- func HomeRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func InitSessions(cfg service.Cfg)
- func IsDiscordAdmin(session *discordgo.Session, guildID string) (bool, error)
- func LoadTemplates(templatesPath string)
- func LoginRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func ManageGuildRoute(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ManageRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type TemplateContext
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskLoginRoute ¶
func AskLoginRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
AskLoginRoute serves login.gohtml
func CallbackRoute ¶
func CallbackRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
CallbackRoute handles return from Discord login
func EditSoundPostRoute ¶
func EditSoundPostRoute(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func EditSoundRoute ¶
func EditSoundRoute(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func GetDiscordSession ¶
GetDiscordSession connects to the API using a session token
func HomeRoute ¶
func HomeRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
HomeRoute serves home.gohtml
func InitSessions ¶
func LoadTemplates ¶
func LoadTemplates(templatesPath string)
LoadTemplates from the specified templatesPath
func LoginRoute ¶
func LoginRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
LoginRoute handles login to Discord
func ManageGuildRoute ¶
func ManageGuildRoute(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
ManageGuildRoute serves manage.gohtml
func ManageRoute ¶
func ManageRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
ManageRoute serves manage.gohtml
Types ¶
type TemplateContext ¶
type TemplateContext struct { NoRedis bool SiteURL string StatsCounter service.CountUpdate }
TemplateContext data is used in every templates
type TemplateData ¶
type TemplateData struct { Context TemplateContext Data interface{} }
TemplateData is used to store data to use in a template
Click to show internal directories.
Click to hide internal directories.