Documentation
¶
Index ¶
- Constants
- func GetAccessToken(tk token.Token, d data.D) (access.Token, error)
- func GetAdvService() token.Service
- func GetService() token.Service
- func IsTokenExpired(code int32) bool
- func NewAdvToken(app token.App) token.Token
- func NewToken(app token.App) token.Token
- func RefreshToken(tk token.Token, d data.D) (access.Token, error)
- type AccessToken
- type AcsData
- type AuthorizerInfo
- type Response
Constants ¶
View Source
const ( Success = 0 AccessTokenExpire = 11000 // access token过期 EmptyAccessToken = 11005 //access token为空 InvalidAccessToken = 11004 //access token错误 RefreshTokenExpire = 11012 // refresh token过期 AuthCodeUsed = 11013 //Authorization code can only be used once. )
https://developers.e.qq.com/docs/reference/errorcode?version=1.3&_preview=1
View Source
const ApiPrefixUrl = "https://api.e.qq.com"
Variables ¶
This section is empty.
Functions ¶
func GetAdvService ¶ added in v1.0.30
func GetService ¶ added in v1.0.28
func IsTokenExpired ¶
Types ¶
type AccessToken ¶
type AccessToken struct { AcsToken string `json:"access_token"` RefToken string `json:"refresh_token"` AcsExpireIn int64 `json:"access_token_expires_in"` RefExpireIn int64 `json:"refresh_token_expires_in"` }
AccessToken * "access_token": "c17348106551c8755165fc090a23ac49",
"refresh_token": "67994d762a30165630e6e66223e72d4d", "access_token_expires_in": 604800, "refresh_token_expires_in": 2592000
func (AccessToken) GetAccessToken ¶
func (a AccessToken) GetAccessToken() access.Value
access.Token interface implement
func (AccessToken) GetRefAccessToken ¶
func (a AccessToken) GetRefAccessToken() access.Value
type AcsData ¶
type AcsData struct { AccessToken AdInfo AuthorizerInfo `json:"authorizer_info,omitempty"` }
type AuthorizerInfo ¶
type AuthorizerInfo struct { AccountUin int64 `json:"account_uin,omitempty"` AccountId int64 `json:"account_id,omitempty"` ScopeList []string `json:"scope_list,omitempty"` WechatAccountId string `json:"wechat_account_id,omitempty"` AccountRoleType string `json:"account_role_type,omitempty"` AccountType string `json:"account_type,omitempty"` RoleType string `json:"role_type,omitempty"` }
Click to show internal directories.
Click to hide internal directories.