Documentation ¶
Index ¶
Constants ¶
View Source
const ( //CacheKeyOfficialAccountPrefix 微信公众号cache key前缀 CacheKeyOfficialAccountPrefix = "gowechat_officialaccount_" //CacheKeyMiniProgramPrefix 小程序cache key前缀 CacheKeyMiniProgramPrefix = "gowechat_miniprogram_" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenHandle ¶
AccessTokenHandle AccessToken 接口
func NewDefaultAccessToken ¶
func NewDefaultAccessToken(appID, appSecret, cacheKeyPrefix string, cache cache.Cache) AccessTokenHandle
NewDefaultAccessToken new DefaultAccessToken
type DefaultAccessToken ¶
type DefaultAccessToken struct {
// contains filtered or unexported fields
}
DefaultAccessToken 默认AccessToken 获取
func (*DefaultAccessToken) GetAccessToken ¶
func (ak *DefaultAccessToken) GetAccessToken() (accessToken string, err error)
GetAccessToken 获取access_token,先从cache中获取,没有则从服务端获取
type DefaultJsTicket ¶
type DefaultJsTicket struct {
// contains filtered or unexported fields
}
DefaultJsTicket 默认获取js ticket方法
type JsTicketHandle ¶
type JsTicketHandle interface { //GetTicket 获取ticket GetTicket(accessToken string) (ticket string, err error) }
JsTicketHandle js ticket获取
func NewDefaultJsTicket ¶
func NewDefaultJsTicket(appID string, cacheKeyPrefix string, cache cache.Cache) JsTicketHandle
NewDefaultJsTicket new
type ResAccessToken ¶
type ResAccessToken struct { util.CommonError AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
ResAccessToken struct
func GetTokenFromServer ¶
func GetTokenFromServer(appID, appSecret string) (resAccessToken ResAccessToken, err error)
GetTokenFromServer 强制从微信服务器获取token
Click to show internal directories.
Click to hide internal directories.