Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrCodeOk = 0 ErrCodeTokenInvalid = 40001 ErrCodeTokenTimeout = 42001 ErrCodeSuiteTokenTimeout = 42004 ErrCodeSuiteTokenInvalid = 42009 ErrCodeSuiteTokenFailure = 48003 )
错误返回码
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CDATAText ¶
type CDATAText struct {
Text string `xml:",innerxml"`
}
CDATAText 用于在 xml 解析时避免转义
func StringToCDATA ¶
StringToCDATA 方法用于将普通文本变换为 CDATAText 类型
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 封装了公共的请求方法
type RecvHTTPReqBody ¶
RecvHTTPReqBody 为回调数据
type RecvHTTPRespBody ¶
type RecvHTTPRespBody struct { XMLName xml.Name `xml:"xml"` Encrypt CDATAText MsgSignature CDATAText TimeStamp int Nonce CDATAText }
RecvHTTPRespBody 为被动响应给微信的数据
type RecvHandler ¶
type RecvHandler interface { Parse(body []byte, signature, timestamp, nonce string) (interface{}, error) Response(message []byte) ([]byte, error) }
RecvHandler 为微信消息回调模式需要实现的接口
type Retrier ¶
type Retrier interface {
Retriable(url string, body []byte) (retriable bool, newURL string, err error)
}
Retrier 是带有重试机制 api 需要实现的接口
type TokenFetcher ¶
TokenFetcher 包含向 API 服务器获取令牌信息的操作
Click to show internal directories.
Click to hide internal directories.