Versions in this module Expand all Collapse all v0 v0.0.5 Feb 18, 2021 Changes in this version + const ServiceType + const SubscriptionsType + var ArticleCountOverError = errors.New("article count over 10") + type Article struct + Description CDATAString + PicUrl CDATAString + Title CDATAString + Url CDATAString + type ArticleItem struct + Item Article + func NewArticleItem(title, description, picUrl, url string) ArticleItem + type ArticleResponseMessage struct + ArticleCount int + Articles []ArticleItem + CreateTime int64 + FromUserName string + MsgType string + ToUserName string + XMLName xml.Name + func NewArticleResponseMessage(to, from string, articles ...ArticleItem) (a ArticleResponseMessage, err error) + type CDATAString struct + CDATA string + type Context interface + Request func() Request + Response func() Response + SetHandler func(h Handler) + Wechat func() *Wechat + type Handler func(Context) error + type ImageMessage interface + MediaId func() string + MsgId func() int64 + PicUrl func() string + type ImageResponseMessage struct + CreateTime int64 + FromUserName string + Image MediaId + MsgType string + ToUserName string + XMLName xml.Name + func NewImageResponseMessage(to, from, mediaId string) ImageResponseMessage + type LinkMessage interface + Description func() string + MsgId func() int64 + Title func() string + Url func() string + type LocationEventMessage interface + Event func() string + Latitude func() + Longitude func() float32 + Precision func() float32 + type LocationMessage interface + Label func() string + LocationX func() + LocationY func() + MsgId func() int64 + Scale func() int + type MediaId struct + MediaId CDATAString + type MenuClickEventMessage interface + Event func() string + EventKey func() string + type MenuViewEventMessage interface + Event func() string + EventKey func() string + MenuId func() int64 + type Middleware func(Handler) Handler + type MsgType int + const EventType + const ImageType + const LinkType + const LocationEventType + const LocationSelectEvenType + const LocationType + const MenuClickEventType + const MenuViewEventType + const PicPhotoOrAlbumEventType + const PicSysphotoEventType + const PicWeixinEventType + const ScanEventType + const ScanSubscribeEventType + const ScancodePushEventType + const ScancodeWaitmsgEventType + const ShortVideoType + const SubscribeEventType + const TemplateSendJobFinishEventType + const TextType + const UnknownType + const UnsubscribeEventType + const VideoType + const VoiceType + type Music struct + Description CDATAString + HQMusicUrl CDATAString + MusicUrl CDATAString + ThumbMediaId string + Title CDATAString + func NewMusic(title, description, musicUrl, HQMusicUrl, thumbMediaId string) Music + type MusicResponseMessage struct + CreateTime int64 + FromUserName string + MsgType string + Music Music + ToUserName string + XMLName xml.Name + func NewMusicResponseMessage(to, from string, music Music) MusicResponseMessage + type PicListItem struct + Item PicMd5Sum + type PicMd5Sum struct + PicMd5Sum string + type Request interface + Content func() string + CreateTime func() int + Description func() string + Event func() string + EventKey func() string + Format func() string + FromUserName func() string + Label func() string + Latitude func() float32 + LocationX func() float64 + LocationY func() float64 + Longitude func() float32 + MediaId func() string + MenuId func() int64 + MsgId func() int64 + MsgType func() MsgType + PicUrl func() string + Precision func() float32 + Recognition func() string + Scale func() int + ScanCodeInfo func() ScanCodeInfo + SendLocationInfo func() SendLocationInfo + SendPicsInfo func() SendPicsInfo + Status func() string + ThumbMediaId func() string + Ticket func() string + Title func() string + ToUserName func() string + Url func() string + type Response interface + Article func(articles ...ArticleItem) error + Bytes func(b []byte) error + Image func(mediaID string) error + Music func(music Music) error + Response func(data interface{}) error + String func(s string) error + Success func() error + Text func(content string) error + Video func(video Video) error + Voice func(mediaID string) error + type Route struct + Handler Handler + Key string + MsgType MsgType + type Router struct + func NewRouter() *Router + func (r *Router) Add(msgType MsgType, key string, route Route) + func (r *Router) Find(c Context) + func (r *Router) Get(msgType MsgType, key string) Handler + type ScanCodeInfo struct + ScanResult string + ScanType string + type ScanEventMessage interface + Event func() string + EventKey func() string + Ticket func() string + type ScanSubscribeEventMessage interface + Event func() string + EventKey func() string + Ticket func() string + type SendLocationInfo struct + Label string + Location_X float64 + Location_Y float64 + Poiname string + Scale float64 + type SendPicsInfo struct + Count int + PicList []PicListItem + type ShortVideoMessage interface + MediaId func() string + MsgId func() int64 + ThumbMediaId func() string + type SubscribeEventMessage interface + Event func() string + type TextMessage interface + Content func() string + MsgId func() int64 + type TextResponseMessage struct + Content CDATAString + CreateTime int64 + FromUserName string + MsgType string + ToUserName string + XMLName xml.Name + func NewTextResponseMessage(to, from, content string) TextResponseMessage + type UnsubscribeEventMessage interface + Event func() string + type Video struct + Description CDATAString + MediaId CDATAString + Title CDATAString + func NewVideo(mediaId, title, description string) Video + type VideoMessage interface + MediaId func() string + MsgId func() int64 + ThumbMediaId func() string + type VideoResponseMessage struct + CreateTime int64 + FromUserName string + MsgType string + ToUserName string + Video Video + XMLName xml.Name + func NewVideoResponseMessage(to, from string, video Video) VideoResponseMessage + type VoiceMessage interface + Format func() string + MediaId func() string + MsgId func() int64 + Recognition func() string + type VoiceResponseMessage struct + CreateTime int64 + FromUserName string + MsgType string + ToUserName string + Voice MediaId + XMLName xml.Name + func NewVoiceResponseMessage(to, from, mediaId string) VoiceResponseMessage + type Wechat struct + AppID string + AppSecret string + EncodingAESKey string + Token string + WechatErrorHandler WechatErrorHandler + WechatType WechatType + func New(appID, appSecret, token, encodingAESKey string, h trader.Handler) (w *Wechat, err error) + func (w *Wechat) Decrypt(msgSignature, timestamp, nonce string, data []byte) (d []byte, err error) + func (w *Wechat) DefaultHandler() Handler + func (w *Wechat) Encrypt(d []byte) (b []byte, err error) + func (w *Wechat) Image(h Handler) + func (w *Wechat) Link(h Handler) + func (w *Wechat) Location(h Handler) + func (w *Wechat) LocationEvent(h Handler) + func (w *Wechat) LocationSelectEven(h Handler) + func (w *Wechat) MenuClickEvent(h Handler) + func (w *Wechat) MenuViewEvent(h Handler) + func (w *Wechat) PicPhotoOrAlbumEvent(h Handler) + func (w *Wechat) PicSysphotoEvent(h Handler) + func (w *Wechat) PicWeixinEvent(h Handler) + func (w *Wechat) ScanEvent(h Handler) + func (w *Wechat) ScanSubscribeEvent(h Handler) + func (w *Wechat) ScancodePushEvent(h Handler) + func (w *Wechat) ScancodeWaitmsgEvent(h Handler) + func (w *Wechat) Server(rw http.ResponseWriter, r *http.Request) + func (w *Wechat) SetDefaultHandler(h Handler) + func (w *Wechat) SetEncodingAesKey(encodingAESKey string) (err error) + func (w *Wechat) ShortVideo(h Handler) + func (w *Wechat) SubscribeEvent(h Handler) + func (w *Wechat) TemplateSendJobFinishEvent(h Handler) + func (w *Wechat) Text(h Handler) + func (w *Wechat) Trader() *trader.Trader + func (w *Wechat) UnsubscribeEvent(h Handler) + func (w *Wechat) Use(m ...Middleware) + func (w *Wechat) Voice(h Handler) + type WechatErrorHandler func(error, Context) error + type WechatType int