Documentation
¶
Index ¶
- func AuthorizerGetAccessToken(tk token.Token, d data.D) (access.Token, error)
- func AuthorizerRefreshToken(tk token.Token, d data.D) (access.Token, error)
- func ClearQuota(api *token.Api) error
- func GetAccessToken(tk token.Token, d data.D) (access.Token, error)
- func GetAuthorizerInfo(api *token.Api, authorizerAppId string) (*Info, *AuthorizationInfo, error)
- func GetComponentAccessToken(tk token.Token, d data.D) (access.Token, error)
- func GetIdService() token.Service
- func GetService() token.Service
- func GetWebService() token.Service
- func NewIdToken(app token.App) token.Token
- func NewToken(app token.App) token.Token
- func NewWebToken(app token.App) token.Token
- func WebGetAccessToken(tk token.Token, d data.D) (access.Token, error)
- func WebRefreshToken(tk token.Token, d data.D) (access.Token, error)
- type AInfo
- type AccessToken
- type Auth
- type Authorization
- type AuthorizationInfo
- type AuthorizerToken
- type FuncInfo
- type Info
- type ListAuthInfo
- type PreAuthCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizerGetAccessToken ¶ added in v1.8.35
AuthorizerGetAccessToken 使用授权码获取授权信息
https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/api/authorization_info.html
func AuthorizerRefreshToken ¶ added in v1.8.35
AuthorizerRefreshToken 获取/刷新接口调用令牌
func ClearQuota ¶
ClearQuota 所有api调用(包括第三方帮其调用)次数进行清零,每月10次 https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Official_Accounts/Official_account_interface.html
func GetAccessToken ¶
GetAccessToken https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/api/component_access_token.html
func GetAuthorizerInfo ¶ added in v1.8.35
https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/api/api_get_authorizer_info.html 获取授权方的帐号基本信息
func GetComponentAccessToken ¶
func GetIdService ¶ added in v1.0.29
func GetService ¶ added in v1.0.29
func GetWebService ¶ added in v1.0.29
func WebGetAccessToken ¶ added in v1.8.35
WebGetAccessToken https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Official_Accounts/official_account_website_authorization.html 第三方平台可以根据本文档相关说明,代替授权公众号发起网页授权 ?appid=APPID&code=CODE&grant_type=authorization_code&component_appid=COMPONENT_APPID&
Types ¶
type AInfo ¶ added in v1.8.35
type AInfo struct { Authorization FuncInfo }
type AccessToken ¶
type AccessToken struct { Token string `json:"component_access_token"` ExpiresIn int64 `json:"expires_in"` }
func (AccessToken) GetAccessToken ¶
func (a AccessToken) GetAccessToken() access.Value
GetAccessToken access.Token interface implement
func (AccessToken) GetRefAccessToken ¶
func (a AccessToken) GetRefAccessToken() access.Value
type Authorization ¶ added in v1.8.35
type AuthorizationInfo ¶ added in v1.8.35
type AuthorizationInfo struct {
Info AInfo `json:"authorization_info"`
}
func (AuthorizationInfo) GetAccessToken ¶ added in v1.8.35
func (a AuthorizationInfo) GetAccessToken() access.Value
GetAccessToken access.Token interface implement
func (AuthorizationInfo) GetRefAccessToken ¶ added in v1.8.35
func (a AuthorizationInfo) GetRefAccessToken() access.Value
type AuthorizerToken ¶ added in v1.8.35
type AuthorizerToken struct { AuthorizerAppId string `json:"authorizer_appid,omitempty"` AcsToken string `json:"authorizer_access_token"` ExpireIn int64 `json:"expires_in"` RefToken string `json:"authorizer_refresh_token"` RefExpireIn int64 `json:"authorizer_refresh_expires_in,omitempty"` }
func (AuthorizerToken) GetAccessToken ¶ added in v1.8.35
func (a AuthorizerToken) GetAccessToken() access.Value
GetAccessToken access.Token interface implement
func (AuthorizerToken) GetRefAccessToken ¶ added in v1.8.35
func (a AuthorizerToken) GetRefAccessToken() access.Value
type Info ¶ added in v1.8.35
type Info struct {
Info map[string]interface{} `json:"authorizer_info"`
}
Info 获取授权方的帐号基本信息
type ListAuthInfo ¶ added in v1.8.35
func GetAuthorizerList ¶ added in v1.8.35
func GetAuthorizerList(api *token.Api, offset, count int) (*ListAuthInfo, error)
type PreAuthCode ¶ added in v1.8.35
func GetPreAuthCode ¶ added in v1.8.35
func GetPreAuthCode(api *token.Api) (*PreAuthCode, error)
GetPreAuthCode 预授权码(pre_auth_code)是第三方平台方实现授权托管的必备信息,每个预授权码有效期为 10 分钟。需要先获取令牌才能调用。