Documentation
¶
Index ¶
- type ConfigInterface
- type ErrorInterface
- type Response
- type Token
- type User
- func (u *User) ContainsError() bool
- func (u *User) GetAccessToken() string
- func (u *User) GetAvatar() string
- func (u *User) GetEmail() string
- func (u *User) GetErrorCode() gcode.Code
- func (u *User) GetExpiresIn() int
- func (u *User) GetID() string
- func (u *User) GetName() string
- func (u *User) GetNickName() string
- func (u *User) GetRaw() *gjson.Json
- func (u *User) GetRefreshToken() string
- type UserInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigInterface ¶
type ErrorInterface ¶
type Response ¶
Response is the struct for client requst response.
type Token ¶
type Token struct {
// AccessToken is the token that authorizes and authenticates
// the requests.
AccessToken string `json:"access_token"`
// TokenType is the type of token.
// The Type method returns either this or "Bearer", the default.
TokenType string `json:"token_type,omitempty"`
// RefreshToken is a token that's used by the application
// (as opposed to the user) to refresh the access token
// if it expires.
RefreshToken string `json:"refresh_token,omitempty"`
// Expiry is the optional expiration time of the access token.
//
// If zero, TokenSource implementations will reuse the same
// token forever and RefreshToken or equivalent
// mechanisms for that TokenSource will not be used.
Expiry gtime.Time `json:"expiry,omitempty"`
}
type User ¶
type User struct {
ID string
Name string
NickName string
Avatar string
Email string
Raw *gjson.Json
Error ErrorInterface
}
func (*User) GetErrorCode ¶
type UserInterface ¶
type UserInterface interface {
// Get oauth user ID,when oauth finished
GetID() string
// Get oauth user name, sometimes name is equal nickname
GetName() string
// Get oauth user nickname, see above GetName()
GetNickName() string
// Get oauth user Avatar
GetAvatar() string
// Get oauth user email
GetEmail() string
// The raw data return like json parsed to gjson.Json,
// see gjson.Json https://pkg.go.dev/github.com/gogf/gf/v2/encoding/gjson
GetRaw() *gjson.Json
// Contains error the oauth server return
ContainsError() bool
// Get error code
// see gcode.Code https://pkg.go.dev/github.com/gogf/gf/v2/errors/gcode
GetErrorCode() gcode.Code
// Get and Set token, token expires
GetAccessToken() string
GetRefreshToken() string
GetExpiresIn() int
}
Click to show internal directories.
Click to hide internal directories.