Documentation ¶
Index ¶
- Constants
- type Context
- func (ctx *Context) GetAccessToken() (accessToken string, err error)
- func (ctx *Context) GetAccessTokenFromServer() (resAccessToken ResAccessToken, err error)
- func (ctx *Context) GetJsAPITicketLock() *sync.RWMutex
- func (ctx *Context) GetQuery(key string) (string, bool)
- func (ctx *Context) Query(key string) string
- func (ctx *Context) Render(bytes []byte)
- func (ctx *Context) SetAccessTokenLock(l *sync.RWMutex)
- func (ctx *Context) SetJsAPITicketLock(lock *sync.RWMutex)
- func (ctx *Context) String(str string)
- func (ctx *Context) XML(obj interface{})
- type ResAccessToken
Constants ¶
View Source
const (
//AccessTokenURL 获取access_token的接口
AccessTokenURL = "https://api.weixin.qq.com/cgi-bin/token"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { AppID string AppSecret string Token string EncodingAESKey string Cache cache.Cache Writer http.ResponseWriter Request *http.Request // contains filtered or unexported fields }
Context struct
func (*Context) GetAccessToken ¶
GetAccessToken 获取access_token
func (*Context) GetAccessTokenFromServer ¶
func (ctx *Context) GetAccessTokenFromServer() (resAccessToken ResAccessToken, err error)
GetAccessTokenFromServer 强制从微信服务器获取token
func (*Context) GetJsAPITicketLock ¶
GetJsAPITicketLock 获取jsAPITicket 的lock
func (*Context) SetAccessTokenLock ¶
SetAccessTokenLock 设置读写锁(一个appID一个读写锁)
func (*Context) SetJsAPITicketLock ¶
SetJsAPITicketLock 设置jsAPITicket的lock
type ResAccessToken ¶
type ResAccessToken struct { util.CommonError AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
ResAccessToken struct
Click to show internal directories.
Click to hide internal directories.