context.go 324 B

123456789101112131415161718
  1. package context
  2. import (
  3. "sync"
  4. "github.com/silenceper/wechat/miniprogram/config"
  5. )
  6. // Context struct
  7. type Context struct {
  8. *config.Config
  9. //accessTokenLock 读写锁 同一个AppID一个
  10. accessTokenLock *sync.RWMutex
  11. //accessTokenFunc 自定义获取 access token 的方法
  12. accessTokenFunc GetAccessTokenFunc
  13. }