oauth

package
v1.16.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeIdentify             = "identify"
	ScopeBot                  = "bot"
	ScopeEmail                = "email"
	ScopeGuilds               = "guilds"
	ScopeGuildsJoin           = "guilds.join"
	ScopeConnections          = "connections"
	ScopeGroupDMJoin          = "gdm.join"
	ScopeMessagesRead         = "messages.read"
	ScopeRPC                  = "rpc"
	ScopeRPCAPI               = "rpc.api"
	ScopeRPCNotificationsRead = "rpc.notifications.read"
	ScopeWebhookIncoming      = "webhook.Incoming"
)

Discord OAuth2 scope.

Variables

View Source
var Conf *oauth2.Config

Conf stores configuration of OAuth with Discord.

Functions

func Client

func Client(context *gin.Context) *http.Client

Client returns pointer to an http.Client.

func Endpoint

func Endpoint() oauth2.Endpoint

Endpoint returns discord OAuth2 endpoints.

func GetSelf

func GetSelf(context *gin.Context) *discordgo.User

GetSelf returns UserInfo of authenticated user.

func GetToken

func GetToken(context *gin.Context) *oauth2.Token

GetToken gets a token stored in session in a context.

func RemoveToken

func RemoveToken(context *gin.Context)

RemoveToken removes a token in session in a context.

func StoreToken

func StoreToken(context *gin.Context, token *oauth2.Token)

StoreToken stores a token in session in a context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL