Documentation ¶
Index ¶
- func CheckResponseError(action string, res *http.Response, val interface{}) error
- type AccessTokenResponse
- type Config
- func (p *Config) AccessToken(code string) (*AccessTokenResponse, error)
- func (p *Config) QrConnectURL(state string, lang string) string
- func (p *Config) RefreshToken(refresh_token string) (*RefreshTokenResponse, error)
- func (p *Config) UserInfo(access_token string, open_id string, lang string) (*UserInfoResponse, error)
- type ErrorResponse
- type RefreshTokenResponse
- type UserInfoResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessTokenResponse ¶
type Config ¶
type Config struct { AppID string `toml:"app-id"` AppSecret string `toml:"app-secret"` RedirectURI string `toml:"redirect-uri"` }
https://developers.weixin.qq.com/doc/oplatform/en/Website_App/WeChat_Login/Wechat_Login.html
func (*Config) AccessToken ¶
func (p *Config) AccessToken(code string) (*AccessTokenResponse, error)
func (*Config) RefreshToken ¶
func (p *Config) RefreshToken(refresh_token string) (*RefreshTokenResponse, error)
type ErrorResponse ¶
type RefreshTokenResponse ¶
type UserInfoResponse ¶
type UserInfoResponse struct { OpenID string `json:"openid"` Nickname string `json:"nickname"` Sex uint32 `json:"sex"` Province string `json:"province"` City string `json:"city"` Country string `json:"country"` HeadImgURL *string `json:"headimgurl,omitempty"` Privilege []string `json:"privilege"` UnionID string `json:"unionid"` }
Click to show internal directories.
Click to hide internal directories.