Documentation ¶
Index ¶
Constants ¶
View Source
const ( //AccessTokenURL 获取access_token的接口 AccessTokenURL = "https://api.weixin.qq.com/cgi-bin/token" //CacheKeyPrefix cache前缀 CacheKeyPrefix = "gowechat_miniprogram_" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context struct
func (*Context) GetAccessToken ¶
GetAccessToken 获取access_token
func (*Context) GetAccessTokenFromServer ¶
func (ctx *Context) GetAccessTokenFromServer() (resAccessToken ResAccessToken, err error)
GetAccessTokenFromServer 强制从微信服务器获取token
func (*Context) SetAccessTokenLock ¶
SetAccessTokenLock 设置读写锁(一个appID一个读写锁)
func (*Context) SetGetAccessTokenFunc ¶
func (ctx *Context) SetGetAccessTokenFunc(f GetAccessTokenFunc)
SetGetAccessTokenFunc 设置自定义获取accessToken的方式, 需要自己实现缓存
type GetAccessTokenFunc ¶
GetAccessTokenFunc 获取 access token 的函数签名
type ResAccessToken ¶
type ResAccessToken struct { util.CommonError AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
ResAccessToken struct
Click to show internal directories.
Click to hide internal directories.