Documentation ¶
Index ¶
Constants ¶
View Source
const ( MsgText = "text" MsgImage = "image" MsgVoice = "voice" MsgVideo = "video" MsgShortVideo = "shortvideo" MsgLocation = "location" MsgLink = "link" )
View Source
const ( EvSubscribe = "subscribe" EvUnsubscribe = "unsubscribe" EvScan = "SCAN" EvLocation = "LOCATION" EvClick = "CLICK" EvView = "VIEW" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Media *media.Media Menu *menu.Menu Template *message.Template User *user.User Account *account.Account *Ev Handlers []gin.HandlerFunc // contains filtered or unexported fields }
func (*API) SetEventHandler ¶
func (w *API) SetEventHandler(handler Handler) Unsubscribe
func (*API) SetMessageHandler ¶
func (w *API) SetMessageHandler(handler Handler) Unsubscribe
type ArticleItem ¶
type Articles ¶
type Articles struct {
Items []ArticleItem `xml:"item"`
}
type ErrorWrapper ¶
type ErrorWrapper []func() error
func (*ErrorWrapper) Add ¶
func (e *ErrorWrapper) Add(f func() error) *ErrorWrapper
func (*ErrorWrapper) Run ¶
func (e *ErrorWrapper) Run() error
type Handler ¶
type Handler func(msg MessageReceive) MessageReply
type MessageHandler ¶
type MessageHandler func(m *MessageReceive) MessageReply
type MessageReceive ¶
type MessageReceive struct { //I do not know what are these for, just leave it untouched XMLName struct{} `xml:"xml"` Text string `xml:",chardata"` MsgId int64 `xml:"MsgId"` //MsgType: text Content string `xml:"Content"` //below types consist of it MediaId string `xml:"MediaId"` //MsgType: image PicUrl string `xml:"PicUrl"` //MsgType: voice Format string `xml:"Format"` //amr, speex Recognition string `xml:"Recognition"` //available when voice recognition is on //MsgType: video, shortvideo ThumbMediaId string `xml:"ThumbMediaId"` //MsgType: location LocationX string `xml:"Location_X"` LocationY string `xml:"Location_Y"` Scale string `xml:"Scale"` Label string `xml:"Label"` //MsgType: link Title string `xml:"Title"` Description string `xml:"Description"` URL string `xml:"Url"` /////////////////////////// //MsgType: event Event string `xml:"Event"` //subscribe, unsubscribe //Event: subscript(first time to subscribe), SCAN(has subscribed) //Event: CLICK, VIEW EventKey string `xml:"EventKey"` Ticket string `xml:"Ticket"` //Event: LOCATION(upload position event) Latitude string `xml:"Latitude"` Longitude string `xml:"Longitude"` Precision string `xml:"Precision"` // contains filtered or unexported fields }
type MessageReply ¶
type MessageReply interface {
Type() string
}
type Music ¶
type Unsubscribe ¶
type Unsubscribe func()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.