Documentation
¶
Index ¶
- Constants
- func NewCryptError(errCode int, errMsg string) error
- func RandString(n int) string
- type AddOrRemoveResp
- type BaseReply
- type CDATA
- type CallEvent
- func (cm *CallEvent) ChatID() string
- func (cm *CallEvent) GetChatType() ChatType
- func (cm *CallEvent) GetEventType() EventType
- func (cm *CallEvent) GetMsgType() MsgType
- func (cm *CallEvent) ImageURLs() []string
- func (cm *CallEvent) MsgID() string
- func (cm *CallEvent) Texts() string
- func (cm *CallEvent) UserID() string
- type ChatType
- type CryptError
- type EnterPrivateChatResp
- type EventType
- type Image
- type MentionedList
- type MixedMessage
- type MsgItem
- type MsgType
- type PRMarkdown
- type PRText
- type PassiveReplyResp
- type PassiveReplyType
- type PrivateChatPicResp
- type ProtocolProcessor
- type ProtocolType
- type Receiver
- type TemplateCarReactResp
- type Text
- type WXBizMsg4Recv
- type WXBizMsg4Send
- type WXBizMsgCrypt
- func (mc *WXBizMsgCrypt) DecryptMsg(msgSignature, timestamp, nonce string, postData []byte) ([]byte, error)
- func (mc *WXBizMsgCrypt) EncryptMsg(replyMsg, timestamp, nonce string) ([]byte, error)
- func (mc *WXBizMsgCrypt) ParsePlainText(plaintext []byte) ([]byte, uint32, []byte, []byte, error)
- func (mc *WXBizMsgCrypt) VerifyURL(msgSignature, timestamp, nonce, echostr string) ([]byte, error)
- type XmlProcessor
Constants ¶
View Source
const ( MText MsgType = "text" MImage MsgType = "image" MMixed MsgType = "mixed" MEvent MsgType = "event" MTCardEvent MsgType = "template_card_event" MSingle ChatType = "single" MGroup ChatType = "group" PRTText PassiveReplyType = "text" PRTMarkdown PassiveReplyType = "markdown" EventAddToChat EventType = "add_to_chat" EventDeleteFromChat EventType = "delete_from_chat" EventEnterChat EventType = "enter_chat" )
View Source
const ( ValidateSignatureError int = -40001 ParseXmlError int = -40002 ComputeSignatureError int = -40003 IllegalAesKey int = -40004 ValidateCorpidError int = -40005 EncryptAESError int = -40006 DecryptAESError int = -40007 IllegalBuffer int = -40008 EncodeBase64Error int = -40009 DecodeBase64Error int = -40010 GenXmlError int = -40010 ParseJsonError int = -40012 GenJsonError int = -40013 IllegalProtocolType int = -40014 )
Variables ¶
This section is empty.
Functions ¶
func NewCryptError ¶
func RandString ¶
Types ¶
type BaseReply ¶
type CallEvent ¶
type CallEvent struct { XMLName xml.Name `xml:"xml"` WebhookUrl CDATA `xml:"WebhookUrl"` MsgId CDATA `xml:"MsgId"` ChatId CDATA `xml:"ChatId"` ChatType CDATA `xml:"ChatType"` From struct { UserId CDATA `xml:"UserId"` } `xml:"From"` MsgType CDATA `xml:"MsgType"` // text/image/mixed/event Text Text Image Image MixedMessage MixedMessage Event struct { EventType CDATA `xml:"EventType"` } `xml:"Event"` }
用户群里@机器人或者单聊中向机器人发送文本消息或图文混排消息
func (*CallEvent) GetChatType ¶
func (*CallEvent) GetEventType ¶
func (*CallEvent) GetMsgType ¶
type CryptError ¶
func (*CryptError) Error ¶
func (ce *CryptError) Error() string
type MentionedList ¶
type MentionedList struct {
Item []CDATA `xml:"Item"`
}
type MixedMessage ¶
type MixedMessage struct {
MsgItem []MsgItem `xml:"MsgItem"`
}
type PRMarkdown ¶
type PRMarkdown struct {
Content CDATA
}
type PRText ¶
type PRText struct { Content CDATA MentionedList MentionedList }
type PassiveReplyResp ¶
type PassiveReplyResp struct { XMLName xml.Name `xml:"xml"` MsgType string Text PRText Markdown PRMarkdown }
type PassiveReplyType ¶
type PassiveReplyType string
type ProtocolProcessor ¶
type ProtocolProcessor interface {
// contains filtered or unexported methods
}
type Receiver ¶
type Receiver interface { Verify(msgSign, timestamp, nonce, echoStr string) ([]byte, error) DecryptMsg(msgSign, timestamp, nonce string, data []byte) ([]byte, error) Register(reply BaseReply) Reply(event *CallEvent) ([]byte, error) SetGroupEvent(e EventType, f func(event *CallEvent) error) SetSingleEvent(f func(event *CallEvent) (string, PassiveReplyType)) }
type WXBizMsg4Recv ¶
type WXBizMsg4Send ¶
type WXBizMsg4Send struct { XMLName xml.Name `xml:"xml"` Encrypt CDATA `xml:"Encrypt"` Signature CDATA `xml:"MsgSignature"` Timestamp string `xml:"TimeStamp"` Nonce CDATA `xml:"Nonce"` }
func NewWXBizMsg4Send ¶
func NewWXBizMsg4Send(encrypt, signature, timestamp, nonce string) *WXBizMsg4Send
type WXBizMsgCrypt ¶
type WXBizMsgCrypt struct {
// contains filtered or unexported fields
}
func NewWXBizMsgCrypt ¶
func NewWXBizMsgCrypt(token, encodingAeskey, receiverId string, protocolType ProtocolType) *WXBizMsgCrypt
func (*WXBizMsgCrypt) DecryptMsg ¶
func (mc *WXBizMsgCrypt) DecryptMsg(msgSignature, timestamp, nonce string, postData []byte) ([]byte, error)
func (*WXBizMsgCrypt) EncryptMsg ¶
func (mc *WXBizMsgCrypt) EncryptMsg(replyMsg, timestamp, nonce string) ([]byte, error)
func (*WXBizMsgCrypt) ParsePlainText ¶
type XmlProcessor ¶
type XmlProcessor struct { }
Click to show internal directories.
Click to hide internal directories.