Versions in this module Expand all Collapse all v0 v0.2.0 Nov 6, 2021 Changes in this version + const ComputeSignatureError + const DecodeBase64Error + const DecryptAESError + const EncodeBase64Error + const EncryptAESError + const FILE + const GenJsonError + const GenXmlError + const IMAGE + const IllegalAesKey + const IllegalBuffer + const IllegalProtocolType + const MaxFileSize + const MaxImageSize + const MaxVideoSize + const MaxVoiceSize + const MinFileSize + const ParseJsonError + const ParseXmlError + const VIDEO + const VOICE + const ValidateCorpidError + const ValidateSignatureError + var ErrSizeLimit = errors.New("exceed the file size limit") + func GetSendURL(c *Client) (string, error) + func GetTemporaryMediaURL(c *Client, mediaType string) (string, error) + func UploadTemporaryMedia(c *Client, mediaType string, name string) (string, error) + type CDATA struct + Value string + type Client struct + BaseURL string + CorpID string + CorpSecret string + HttpClient *http.Client + func NewClient(corpID, corpSecret string) *Client + func (c *Client) AccessToken() (string, error) + func (c *Client) Get(url string, body io.Reader) (resp *http.Response, err error) + func (c *Client) Post(url, contentType string, body io.Reader) (resp *http.Response, err error) + func (c *Client) RenewAccessToken() error + func (c Client) TokenExpired() bool + type CryptError struct + ErrCode int + ErrMsg string + func NewCryptError(err_code int, err_msg string) *CryptError + type FileMessage struct + AgentID int + DuplicateCheckInterval int + EnableDuplicateCheck int + File struct{ ... } + MsgType string + Safe int + ToParty string + ToTag string + ToUser string + func (m FileMessage) ToJSON() ([]byte, error) + type ImageMessage struct + AgentID int + DuplicateCheckInterval int + EnableDuplicateCheck int + Image struct{ ... } + MsgType string + Safe int + ToParty string + ToTag string + ToUser string + func (m ImageMessage) ToJSON() ([]byte, error) + type MarkdownMessage struct + AgentID int + DuplicateCheckInterval int + EnableDuplicateCheck int + Markdown struct{ ... } + MsgType string + ToParty string + ToTag string + ToUser string + func (m MarkdownMessage) ToJSON() ([]byte, error) + type Message interface + ToJSON func() ([]byte, error) + type MessageResponse struct + ErrCode int + ErrMsg string + InvalidParty string + InvalidTag string + InvalidUser string + MsgID string + ResponseCode string + func SendMessage(c *Client, m Message) (*MessageResponse, error) + func (r *MessageResponse) UnMarshalFromJSON(p []byte) error + type NewsMessage struct + AgentID int + DuplicateCheckInterval int + EnableDuplicateCheck int + EnableIDTrans int + MsgType string + News struct{ ... } + ToParty string + ToTag string + ToUser string + func (m NewsMessage) ToJSON() ([]byte, error) + type ProtocolProcessor interface + type ProtocolType int + const XmlType + type Response interface + UnMarshalFromJSON func([]byte) error + type TemporaryMediaResponse struct + CreatedAt string + ErrCode int + ErrMsg string + MediaId string + Type string + func (r *TemporaryMediaResponse) UnMarshalFromJSON(p []byte) error + type TextCardMessage struct + AgentID int + DuplicateCheckInterval int + EnableDuplicateCheck int + EnableIDTrans int + MsgType string + TextCard struct{ ... } + ToParty string + ToTag string + ToUser string + func (m TextCardMessage) ToJSON() ([]byte, error) + type TextMessage struct + AgentID int + DuplicateCheckInterval int + EnableDuplicateCheck int + EnableIdTrans int + MsgType string + Safe int + Text struct{ ... } + ToParty string + ToTag string + ToUser string + func (m TextMessage) ToJSON() ([]byte, error) + type TokenResponse struct + AccessToken string + ErrCode int + ErrMsg string + ExpiresIn int + func (r *TokenResponse) UnMarshalFromJSON(p []byte) error + type VideoMessage struct + AgentID int + DuplicateCheckInterval int + EnableDuplicateCheck int + MsgType string + Safe int + ToParty string + ToTag string + ToUser string + Video struct{ ... } + func (m VideoMessage) ToJSON() ([]byte, error) + type VoiceMessage struct + AgentID int + DuplicateCheckInterval int + EnableDuplicateCheck int + MsgType string + ToParty string + ToTag string + ToUser string + Voice struct{ ... } + func (m VoiceMessage) ToJSON() ([]byte, error) + type WXBizMsg4Recv struct + Agentid string + Encrypt string + Tousername string + type WXBizMsg4Send struct + Encrypt CDATA + Nonce CDATA + Signature CDATA + Timestamp string + XMLName xml.Name + func NewWXBizMsg4Send(encrypt, signature, timestamp, nonce string) *WXBizMsg4Send + type WXBizMsgCrypt struct + func NewWXBizMsgCrypt(token, encoding_aeskey, receiver_id string, protocol_type ProtocolType) *WXBizMsgCrypt + func (self *WXBizMsgCrypt) DecryptMsg(msg_signature, timestamp, nonce string, post_data []byte) ([]byte, *CryptError) + func (self *WXBizMsgCrypt) EncryptMsg(reply_msg, timestamp, nonce string) ([]byte, *CryptError) + func (self *WXBizMsgCrypt) ParsePlainText(plaintext []byte) ([]byte, uint32, []byte, []byte, *CryptError) + func (self *WXBizMsgCrypt) VerifyURL(msg_signature, timestamp, nonce, echostr string) ([]byte, *CryptError) + type XmlProcessor struct