Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CacheKeyOfficialAccountPrefix 微信公众号cache key前缀 CacheKeyOfficialAccountPrefix = "gowechat_officialaccount_" // CacheKeyMiniProgramPrefix 小程序cache key前缀 CacheKeyMiniProgramPrefix = "gowechat_miniprogram_" // CacheKeyWorkPrefix 企业微信cache key前缀 CacheKeyWorkPrefix = "gowechat_work_" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenHandle ¶
type AccessTokenHandle interface { // GetAccessToken 直接换取accessToken(服务器对服务器应用) GetAccessToken() (accessToken string, err error) }
func NewWorkAccessToken ¶
func NewWorkAccessToken(opts ...Option) AccessTokenHandle
NewWorkAccessToken new WorkAccessToken
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
type CommonError ¶
type Option ¶
type Option func(handler *BaseHandler)
type ResAccessToken ¶
type ResAccessToken struct { CommonError AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
ResAccessToken struct
func GetTokenFromServer ¶
func GetTokenFromServer(url string) (resAccessToken ResAccessToken, err error)
GetTokenFromServer 强制从微信服务器获取token
type WorkAccessToken ¶
type WorkAccessToken struct {
// contains filtered or unexported fields
}
WorkAccessToken 企业微信AccessToken 获取
func (*WorkAccessToken) GetAccessToken ¶
func (ak *WorkAccessToken) GetAccessToken() (accessToken string, err error)
GetAccessToken 企业微信获取access_token,先从cache中获取,没有则从服务端获取
Click to show internal directories.
Click to hide internal directories.