Documentation
¶
Index ¶
- type Api
- func (a Api) DeleteChannel(c *gin.Context)
- func (a Api) GuildListMiddleware() gin.HandlerFunc
- func (a Api) HandleDiscordLogin(c *gin.Context)
- func (a Api) HandleDiscordLogout(c *gin.Context)
- func (a Api) SessionMiddleware() gin.HandlerFunc
- func (a Api) Stats(c *gin.Context)
- func (a Api) SubscribedChannels(c *gin.Context)
- func (a Api) UpdateChannel(c *gin.Context)
- func (a Api) UserInfo(c *gin.Context)
- func (a Api) VerifySession(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
Api contains everything required to run the API section of the server.
func (Api) DeleteChannel ¶
DeleteChannel deletes ("unsubscribes") a channel from the database.
func (Api) GuildListMiddleware ¶
func (a Api) GuildListMiddleware() gin.HandlerFunc
GuildListMiddleware gets a GuildList using the clients session.
func (Api) HandleDiscordLogin ¶
HandleDiscordLogin is the endpoint handler for when a user authenticates using Discords OAuth flow.
func (Api) HandleDiscordLogout ¶
HandleDiscordLogout is for when a user wants to invalidate their session that contains Discord OAuth info.
func (Api) SessionMiddleware ¶
func (a Api) SessionMiddleware() gin.HandlerFunc
SessionMiddleware checks for and passes along a decrypted users session as a database.SessionRecord.
func (Api) SubscribedChannels ¶
SubscribedChannels returns a list of information about guilds user is authed in that are subscribed to the notification service.
func (Api) UpdateChannel ¶
UpdateChannel updates information about a channel in the database.
func (Api) VerifySession ¶
VerifySession allows the frontend to determine if the user has an active and valid session or not.