Documentation
¶
Index ¶
- type Article
- type ArticleCollection
- type ClickEventMessage
- type Handler
- type Image
- type ImageNormalMessage
- type ImageReply
- type Kind
- type LinkNormalMessage
- type LocationEventMessage
- type LocationNormalMessage
- type Message
- func (m *Message) GetMessage() *Message
- func (m *Message) Reply() ([]byte, error)
- func (m *Message) ReplyImage(img *Image) ([]byte, error)
- func (m *Message) ReplyMusic(music *Music) ([]byte, error)
- func (m *Message) ReplyNews(articles []*Article) ([]byte, error)
- func (m *Message) ReplyText(content string) ([]byte, error)
- func (m *Message) ReplyVideo(video *Video) ([]byte, error)
- func (m *Message) ReplyVoice(voice *Voice) ([]byte, error)
- type Messager
- type Music
- type MusicReply
- type NewsReply
- type ShortVideoNormalMessage
- type SubscribeEventMessage
- type SubscribedScanEventMessage
- type TextNormalMessage
- type TextReply
- type UnSubscribeEventMessage
- type UnSubscribedScanEventMessage
- type Video
- type VideoNormalMessage
- type VideoReply
- type ViewEventMessage
- type Voice
- type VoiceNormalMessage
- type VoiceReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleCollection ¶
type ArticleCollection struct {
Items []*Article `xml:"item"`
}
type ClickEventMessage ¶
type ClickEventMessage struct {
*Message
}
func (*ClickEventMessage) GetKind ¶
func (m *ClickEventMessage) GetKind() Kind
func (*ClickEventMessage) Reply ¶
func (m *ClickEventMessage) Reply() ([]byte, error)
type ImageNormalMessage ¶
type ImageNormalMessage struct {
*Message
}
func (*ImageNormalMessage) GetKind ¶
func (m *ImageNormalMessage) GetKind() Kind
type ImageReply ¶
type Kind ¶
type Kind int
const ( MessageKindUnknown Kind = iota MessageKindNormalText // 文字消息 MessageKindNormalImage // 图片消息 MessageKindNormalVoice // 语音消息 MessageKindNormalVideo // 视频消息 MessageKindNormalShortVideo // 短视频消息 MessageKindNormalLocation // 地理位置消息 MessageKindNormalLink // 链接消息 MessageKindEventSubscribe // 订阅事件 MessageKindEventUnSubscribe // 取消订阅事件 MessageKindEventUnSubscribedScan // 未关注用户扫码事件 MessageKindEventSubscribedScan // 关注用户扫码事件 MessageKindEventLocation // 位置上报事件 MessageKindEventClick // 点击事件 MessageKindEventView // 跳转链接事件 )
type LinkNormalMessage ¶
type LinkNormalMessage struct {
*Message
}
func (*LinkNormalMessage) GetKind ¶
func (m *LinkNormalMessage) GetKind() Kind
type LocationEventMessage ¶
type LocationEventMessage struct {
*Message
}
func (LocationEventMessage) GetKind ¶
func (m LocationEventMessage) GetKind() Kind
func (*LocationEventMessage) Reply ¶
func (m *LocationEventMessage) Reply() ([]byte, error)
type LocationNormalMessage ¶
type LocationNormalMessage struct {
*Message
}
func (*LocationNormalMessage) GetKind ¶
func (m *LocationNormalMessage) GetKind() Kind
type Message ¶
type Message struct {
XMLName xml.Name `xml:"xml"`
ToUserName string
FromUserName string
CreateTime int64
MsgType string
// 事件消息: 抽取事件消息的公共部分,避免二次解析
Event string // 事件消息
EventKey string // 事件消息
Ticket string // 事件消息
Latitude float64 // 地理位置上报事件
Longitude float64 // 地理位置上报事件
Precision float64 // 地理位置上报事件
// 普通消息: 抽取事件消息的公共部分,避免二次解析
MsgId int64 // 消息ID
MsgDataId string // 消息数据ID
Idx int // 多图文时第几篇文章,从1开始
Content string // 文本消息: 文本消息内容
MediaId string // 图片消息|语音消息|视频消息: 媒体id,可以调用获取临时素材接口拉取数据
Format string // 语音消息: 语音格式,如amr,speex等
MediaId16K string // 语音消息: 16K采样率语音消息媒体id,可以调用获取临时素材接口拉取数据,返回16K采样率amr/speex语音
PicUrl string // 图片消息: 图片链接(由系统生成)
ThumbMediaId string // 视频消息: 媒体id,可以调用多媒体文件下载接口拉取数据
}
func (*Message) GetMessage ¶
type MusicReply ¶
type ShortVideoNormalMessage ¶
type ShortVideoNormalMessage struct {
*Message
}
func (*ShortVideoNormalMessage) GetKind ¶
func (m *ShortVideoNormalMessage) GetKind() Kind
type SubscribeEventMessage ¶
type SubscribeEventMessage struct {
*Message
}
func (*SubscribeEventMessage) GetKind ¶
func (m *SubscribeEventMessage) GetKind() Kind
func (*SubscribeEventMessage) Reply ¶
func (m *SubscribeEventMessage) Reply() ([]byte, error)
type SubscribedScanEventMessage ¶
type SubscribedScanEventMessage struct {
*Message
}
func (*SubscribedScanEventMessage) GetKind ¶
func (m *SubscribedScanEventMessage) GetKind() Kind
func (*SubscribedScanEventMessage) Reply ¶
func (m *SubscribedScanEventMessage) Reply() ([]byte, error)
type TextNormalMessage ¶
type TextNormalMessage struct {
*Message
}
func (*TextNormalMessage) GetKind ¶
func (m *TextNormalMessage) GetKind() Kind
type UnSubscribeEventMessage ¶
type UnSubscribeEventMessage struct {
*Message
}
func (*UnSubscribeEventMessage) GetKind ¶
func (m *UnSubscribeEventMessage) GetKind() Kind
func (*UnSubscribeEventMessage) Reply ¶
func (m *UnSubscribeEventMessage) Reply() ([]byte, error)
type UnSubscribedScanEventMessage ¶
type UnSubscribedScanEventMessage struct {
*Message
}
func (*UnSubscribedScanEventMessage) GetKind ¶
func (m *UnSubscribedScanEventMessage) GetKind() Kind
func (*UnSubscribedScanEventMessage) Reply ¶
func (m *UnSubscribedScanEventMessage) Reply() ([]byte, error)
type VideoNormalMessage ¶
type VideoNormalMessage struct {
*Message
}
func (*VideoNormalMessage) GetKind ¶
func (m *VideoNormalMessage) GetKind() Kind
type VideoReply ¶
type ViewEventMessage ¶
type ViewEventMessage struct {
*Message
}
func (*ViewEventMessage) GetKind ¶
func (m *ViewEventMessage) GetKind() Kind
func (*ViewEventMessage) Handle ¶
func (m *ViewEventMessage) Handle() ([]byte, error)
type VoiceNormalMessage ¶
type VoiceNormalMessage struct {
*Message
}
func (*VoiceNormalMessage) GetKind ¶
func (m *VoiceNormalMessage) GetKind() Kind
Source Files
¶
- event_message_click.go
- event_message_location.go
- event_message_sub.go
- event_message_sub_scan.go
- event_message_unsub.go
- event_message_unsub_scan.go
- event_message_view.go
- factory.go
- message.go
- normal_message_image.go
- normal_message_link.go
- normal_message_location.go
- normal_message_short_video.go
- normal_message_text.go
- normal_message_video.go
- normal_message_voice.go
- reply_image.go
- reply_music.go
- reply_news.go
- reply_text.go
- reply_video.go
- reply_voice.go
Click to show internal directories.
Click to hide internal directories.