Documentation ¶
Index ¶
- func AuthPacket(mchid, serialno, signature, timestamp, nonce string) string
- func NotifyPacket(timestamp, nonce, body string) string
- func SignPacket(method, URL, timestamp, nonce, body string) string
- type WxIFAgent
- func (w *WxIFAgent) ToWxCodeUrl(redirecturl string, state ...string) string
- func (w *WxIFAgent) ToWxRefreshUrl(accesscode string) string
- func (w *WxIFAgent) ToWxTokenUrl(requestcode string) string
- func (w *WxIFAgent) ToWxUserUrl(accesstoken, openid string) string
- func (w *WxIFAgent) ToWxVerifyUrl(accesstoken, openid string) string
- type WxResult
- type WxToken
- type WxUserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthPacket ¶ added in v1.0.13
AuthPacket generate wechat authorization string packet
func NotifyPacket ¶ added in v1.0.13
NotifyPacket generate wechat notification string packet
func SignPacket ¶ added in v1.0.13
SignPacket generate wechat signature string packet
Types ¶
type WxIFAgent ¶
type WxIFAgent struct { AppID string // Unique marker for official account AppSecret string // Appsecret of the official account Scope string // 'snsapi_base' or 'snsapi_userinfo' }
WxIFAgent wechat interfaces agent
func (*WxIFAgent) ToWxCodeUrl ¶
ToWxCodeUrl bind redirect url and return wechat url to get request code Step 1
func (*WxIFAgent) ToWxRefreshUrl ¶
ToWxRefreshUrl bind expired access toke and return wechat url to refresh it Step 3
func (*WxIFAgent) ToWxTokenUrl ¶
ToWxTokenUrl bind request code and return wechat url to get access token Step 2
func (*WxIFAgent) ToWxUserUrl ¶
ToWxUserUrl bind access token and openid, than return wechat url to get user informations Step 4
func (*WxIFAgent) ToWxVerifyUrl ¶
ToWxVerifyUrl bind access token and openid, than return wechat url to check access token expires Step Annex
type WxToken ¶
type WxToken struct { AccessToken string `json:"access_token"` Expires int `json:"expires_in"` RefreshToken string `json:"refresh_token"` OpenID string `json:"openid"` Scope string `json:"scope"` }
WxToken wechat access and refresh tokens
type WxUserInfo ¶
type WxUserInfo struct { OpenID string `json:"openid"` Nickname string `json:"nickname"` Sex int `json:"sex"` Province string `json:"province"` City string `json:"city"` Country string `json:"country"` Headimgurl string `json:"headimgurl"` Privilege []string `json:"privilege"` UnionID string `json:"unionid"` }
WxUserInfo wechat user informations