Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Unknown is the code used for unknown errors. Unknown = ErrorCode(0) // InvalidBody is the code used when we cannot decode the request body InvalidBody = ErrorCode(1) // ValidationError is the code used when the request body fails validation ValidationError = ErrorCode(2) // InvalidToken is the code used when the token is invalid. InvalidToken = ErrorCode(3) )
Variables ¶
View Source
var ( // InvalidTokenError is returned when the session token is invalid InvalidTokenError = NewError(InvalidToken, "Invalid token") // InvalidBodyError is returned when we cannot decode the request body InvalidBodyError = NewError(InvalidBody, "Invalid body") // UnknownError is the error instance used as a fallback error UnknownError = NewError(Unknown, "Something went wrong, please try again later.") )
Functions ¶
This section is empty.
Types ¶
type CreateUserInput ¶
type Error ¶
type Error struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
Metadata interface{} `json:"metadata,omitempty"`
}
Error defines the error body
type LoginUserInput ¶
type LoginUserInput struct {
Id string `json:"id"`
AccentColor float64 `json:"accent_color"`
Avatar string `json:"avatar"`
AvatarDecoration string `json:"avatar_decoratio_data"`
Banner string `json:"banner"`
BannerColor string `json:"banner_color"`
Flags float64 `json:"flags"`
MfaEnabled bool `json:"mfa_enabled"`
PremiumType float64 `json:"premium_type"`
PublicFlags float64 `json:"public_flags"`
Discriminator string `json:"discriminator"`
GlobalName string `json:"global_name"`
Locale string `json:"locale"`
Username string `json:"username"`
}
func ParsingUserInput ¶
func ParsingUserInput(input map[string]interface{}) (*LoginUserInput, error)
type NewLinkInput ¶
type TokenInput ¶
type TokenInput struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresIn float64 `json:"expires_in"`
Scope string `json:"scope"`
TokenType string `json:"token_type"`
}
func ParsingTokenInput ¶
func ParsingTokenInput(input map[string]interface{}) (*TokenInput, error)
Click to show internal directories.
Click to hide internal directories.