Documentation ¶
Index ¶
- type Cache
- type DistributedAccessTokenHandle
- type OfficialAccount
- func NewOfficialAccount(config *OfficialAccountConfig, cache Cache, distributedLock lock.Locker) *OfficialAccount
- func NewOfficialAccountByMemory(config *OfficialAccountConfig) *OfficialAccount
- func NewOfficialAccountByRedis(config *OfficialAccountConfig, redisClient redis.UniversalClient) *OfficialAccount
- type OfficialAccountConfig
- type Redis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistributedAccessTokenHandle ¶
type DistributedAccessTokenHandle struct {
// contains filtered or unexported fields
}
DistributedAccessTokenHandle AccessToken 获取 @Description 重写credential.DefaultAccessToken,实现分布式锁,支持多实例部署
func NewDistributedAccessTokenHandle ¶
func NewDistributedAccessTokenHandle( appID, appSecret, cacheKeyPrefix string, cache Cache, distributedLock lock.Locker, ) *DistributedAccessTokenHandle
NewDistributedAccessTokenHandle new DistributedAccessTokenHandle
func (*DistributedAccessTokenHandle) GetAccessToken ¶
func (ak *DistributedAccessTokenHandle) GetAccessToken() (accessToken string, err error)
GetAccessToken 获取access_token,先从cache中获取,没有则从服务端获取
func (*DistributedAccessTokenHandle) GetAccessTokenContext ¶
func (ak *DistributedAccessTokenHandle) GetAccessTokenContext(ctx context.Context) (accessToken string, err error)
GetAccessTokenContext 获取access_token,先从cache中获取,没有则从服务端获取
func (*DistributedAccessTokenHandle) RefreshAccessToken ¶
func (ak *DistributedAccessTokenHandle) RefreshAccessToken() (err error)
RefreshAccessToken 刷新access_token
type OfficialAccount ¶
type OfficialAccount struct { officialaccount.OfficialAccount // contains filtered or unexported fields }
func NewOfficialAccount ¶
func NewOfficialAccount(config *OfficialAccountConfig, cache Cache, distributedLock lock.Locker) *OfficialAccount
func NewOfficialAccountByMemory ¶
func NewOfficialAccountByMemory(config *OfficialAccountConfig) *OfficialAccount
func NewOfficialAccountByRedis ¶
func NewOfficialAccountByRedis(config *OfficialAccountConfig, redisClient redis.UniversalClient) *OfficialAccount
func (*OfficialAccount) StartTokenChecking ¶
func (oa *OfficialAccount) StartTokenChecking()
type OfficialAccountConfig ¶
Click to show internal directories.
Click to hide internal directories.