StableAccessToken 获取稳定版接口调用凭据(与getAccessToken获取的调用凭证完全隔离,互不影响) 不强制更新access_token,可用于不同环境不同服务而不需要分布式锁以及公用缓存,避免access_token争抢 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getStableAccessToken.html
| 101 | // 不强制更新access_token,可用于不同环境不同服务而不需要分布式锁以及公用缓存,避免access_token争抢 |
| 102 | // https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getStableAccessToken.html |
| 103 | type StableAccessToken struct { |
| 104 | appID string |
| 105 | appSecret string |
| 106 | cacheKeyPrefix string |
| 107 | cache cache.Cache |
| 108 | accessTokenLock *sync.Mutex |
| 109 | } |
| 110 | |
| 111 | // NewStableAccessToken new StableAccessToken |
| 112 | func NewStableAccessToken(appID, appSecret, cacheKeyPrefix string, cache cache.Cache) AccessTokenContextHandle { |
nothing calls this directly
no outgoing calls
no test coverage detected