Documentation ¶
Index ¶
- Constants
- func GetCallbackURL() string
- func GetDiscordAccessToken(ctx context.Context, code string) (string, error)
- func GetDiscordData(ctx context.Context, accessToken string) (string, error)
- func GetDiscordURL() string
- func GetFrontendURL() string
- func GetGithubAccessToken(ctx context.Context, code string) (string, error)
- func GetGithubClientID() string
- func GetGithubData(ctx context.Context, accessToken string) (string, error)
- func InitDiscord(config DiscordConfig)
- func InitGithub(config GithubConfig)
- func SetOauthConfig(config GlobalConfig)
- type DiscordConfig
- type DiscordLogin
- type GithubConfig
- type GlobalConfig
Constants ¶
View Source
const ( // RequestFailed is the error message when a request fails. RequestFailed = "request failed" // ResponseFailed is the error message when a response fails. ResponseFailed = "response failed" )
Variables ¶
This section is empty.
Functions ¶
func GetCallbackURL ¶
func GetCallbackURL() string
func GetDiscordAccessToken ¶
GetDiscordAccessToken gets the access token from Discord.
func GetDiscordData ¶
GetDiscordData gets the user data from Discord.
func GetDiscordURL ¶
func GetDiscordURL() string
func GetFrontendURL ¶
func GetFrontendURL() string
func GetGithubAccessToken ¶
GetGithubAccessToken gets the access token from Github using the code.
func GetGithubClientID ¶
func GetGithubClientID() string
func GetGithubData ¶
GetGithubData gets the user data from Github using the access token.
func InitDiscord ¶
func InitDiscord(config DiscordConfig)
InitDiscord initializes the Discord oauth configuration.
func InitGithub ¶
func InitGithub(config GithubConfig)
InitGithub initializes the Github oauth configuration.
func SetOauthConfig ¶
func SetOauthConfig(config GlobalConfig)
Types ¶
type DiscordConfig ¶
type DiscordLogin ¶
type DiscordLogin struct { ID string `json:"id"` Username string `json:"username"` Avatar string `json:"avatar"` Email string `json:"email"` }
DiscordLogin is a struct that represents the Discord login response.
type GithubConfig ¶
type GlobalConfig ¶
Click to show internal directories.
Click to hide internal directories.