Versions in this module Expand all Collapse all v1 v1.0.0 Nov 10, 2022 Changes in this version + const CacheKeyMiniProgramPrefix + const CacheKeyOfficialAccountPrefix + const CacheKeyWorkPrefix + type AccessTokenContextHandle interface + GetAccessTokenContext func(ctx context.Context) (accessToken string, err error) + func NewDefaultAccessToken(appID, appSecret, cacheKeyPrefix string, cache cache.Cache) AccessTokenContextHandle + func NewWorkAccessToken(corpID, corpSecret, cacheKeyPrefix string, cache cache.Cache) AccessTokenContextHandle + type AccessTokenHandle interface + GetAccessToken func() (accessToken string, err error) + type DefaultAccessToken struct + func (ak *DefaultAccessToken) GetAccessToken() (accessToken string, err error) + func (ak *DefaultAccessToken) GetAccessTokenContext(ctx context.Context) (accessToken string, err error) + type DefaultJsTicket struct + func (js *DefaultJsTicket) GetTicket(accessToken string) (ticketStr string, err error) + type JsTicketHandle interface + GetTicket func(accessToken string) (ticket string, err error) + func NewDefaultJsTicket(appID string, cacheKeyPrefix string, cache cache.Cache) JsTicketHandle + type ResAccessToken struct + AccessToken string + ExpiresIn int64 + func GetTokenFromServer(url string) (resAccessToken ResAccessToken, err error) + func GetTokenFromServerContext(ctx context.Context, url string) (resAccessToken ResAccessToken, err error) + type ResTicket struct + ExpiresIn int64 + Ticket string + func GetTicketFromServer(accessToken string) (ticket ResTicket, err error) + type WorkAccessToken struct + CorpID string + CorpSecret string + func (ak *WorkAccessToken) GetAccessToken() (accessToken string, err error) + func (ak *WorkAccessToken) GetAccessTokenContext(ctx context.Context) (accessToken string, err error)