Documentation
¶
Index ¶
- type Config
- func (c *Config) GetAuthUrl() string
- func (c *Config) GetTokenFromCode(ctx context.Context, code string) (token *gjson.Json)
- func (c *Config) GetUserByToken(ctx context.Context, token string) (user *core.User, err error)
- func (c *Config) SetScopes(scopes []string)
- func (c *Config) SetState(state ...string)
- func (c *Config) UserFromCode(ctx context.Context, code string) (user *core.User, err error)
- type Endpoint
- type OpenplatformConfig
- 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
- func (u *User) SetAccessToken(token string) error
- func (u *User) SetExpiresIn(expiresIn int) error
- func (u *User) SetRefreshToken(token string) error
- type WechatError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// AppID is ClientID is the application's ID.
// ClientID string
AppID string
// ClientSecret is the application's secret.
Secret string
// Endpoint contains the resource server's token endpoint
// URLs. These are constants specific to each server and are
// often available via site-specific packages, such as
// google.Endpoint or github.Endpoint.
Endpoint Endpoint
// RedirectURL is the URL to redirect users going through
// the OAuth flow, after the resource owner's URLs.
// RedirectURL string
RedirectUri string
// Scope specifies optional requested permissions.
Scopes []string
// State
State string
// Lang
Lang string
}
func (*Config) GetAuthUrl ¶
func (*Config) GetTokenFromCode ¶
GetTokenFromCode
func (*Config) GetUserByToken ¶
GetUserFromToken
type OpenplatformConfig ¶
type OpenplatformConfig struct{}
type User ¶
type User struct {
Raw *gjson.Json
ID string
Name string
NickName string
Avatar string
Email string
Error error
}
User
func (*User) GetErrorCode ¶
type WechatError ¶
func (*WechatError) Code ¶
func (e *WechatError) Code() gcode.Code
@see https://goframe.org/pages/viewpage.action?pageId=30739597
Click to show internal directories.
Click to hide internal directories.