Documentation
¶
Index ¶
- Constants
- type AccessToken
- type Article
- type Button
- type Music
- type Request
- type Video
- type Weixinmp
- func (this *Weixinmp) CreateCustomMenu(btn *[]Button) error
- func (this *Weixinmp) CreateQRLimitScene(expireSeconds, sceneId int64) (string, error)
- func (this *Weixinmp) CreateQRScene(sceneId int64) (string, error)
- func (this *Weixinmp) DeleteCustomMenu() error
- func (this *Weixinmp) DownloadMediaFile(mediaId, fileName string) error
- func (this *Weixinmp) GetCustomMenu() ([]Button, error)
- func (this *Weixinmp) GetQRCodeURL(ticket string) string
- func (this *Weixinmp) ReplyImageMsg(rw http.ResponseWriter, mediaId string) error
- func (this *Weixinmp) ReplyMusicMsg(rw http.ResponseWriter, music *Music) error
- func (this *Weixinmp) ReplyNewsMsg(rw http.ResponseWriter, articles *[]Article) error
- func (this *Weixinmp) ReplyTextMsg(rw http.ResponseWriter, content string) error
- func (this *Weixinmp) ReplyVideoMsg(rw http.ResponseWriter, video *Video) error
- func (this *Weixinmp) ReplyVoiceMsg(rw http.ResponseWriter, mediaId string) error
- func (this *Weixinmp) SendImageMsg(touser string, mediaId string) error
- func (this *Weixinmp) SendMusicMsg(touser string, music *Music) error
- func (this *Weixinmp) SendNewsMsg(touser string, articles *[]Article) error
- func (this *Weixinmp) SendTextMsg(touser string, content string) error
- func (this *Weixinmp) SendVideoMsg(touser string, video *Video) error
- func (this *Weixinmp) SendVoiceMsg(touser string, mediaId string) error
- func (this *Weixinmp) UploadMediaFile(mediaType, fileName string) (string, error)
Constants ¶
View Source
const ( // request message types MsgTypeText = "text" MsgTypeImage = "image" MsgTypeVoice = "voice" MsgTypeVideo = "video" MsgTypeLocation = "location" MsgTypeLink = "link" MsgTypeEvent = "event" // event types EventSubscribe = "subscribe" EventUnsubscribe = "unsubscribe" EventScan = "SCAN" EventLocation = "LOCATION" EventClick = "CLICK" EventView = "VIEW" // media types MediaTypeImage = "image" MediaTypeVoice = "voice" MediaTypeVideo = "video" MediaTypeThumb = "thumb" // button types ButtonTypeClick = "click" ButtonTypeView = "view" // environment constants UrlPrefix = "https://api.weixin.qq.com/cgi-bin/" MediaUrlPrefix = "http://file.api.weixin.qq.com/cgi-bin/media/" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
func (*AccessToken) Fresh ¶
func (this *AccessToken) Fresh() (string, error)
get fresh access_token string
type Request ¶
type Request struct {
Token string
// request common fields
ToUserName string
FromUserName string
CreateTime int64
MsgType string
// message request fields
Content string
MsgId int64
PicUrl string
MediaId string
Format string
ThumbMediaId string
LocationX float64 `xml:"Location_X"`
LocationY float64 `xml:"Location_Y"`
Scale float64
Label string
Title string
Description string
Url string
Recognition string
// event request fields
Event string
EventKey string
Ticket string
Latitude float64
Longitude float64
Precision float64
}
request from weixinmp
type Weixinmp ¶
type Weixinmp struct {
Request *Request
AccessToken *AccessToken
}
func (*Weixinmp) CreateCustomMenu ¶
create custom menu
func (*Weixinmp) CreateQRLimitScene ¶
create temporary qrcode
func (*Weixinmp) CreateQRScene ¶
create permanent qrcode
func (*Weixinmp) DeleteCustomMenu ¶
delete custom menu
func (*Weixinmp) DownloadMediaFile ¶
download media to file
func (*Weixinmp) GetCustomMenu ¶
get custom menu
func (*Weixinmp) GetQRCodeURL ¶
get qrcode url
func (*Weixinmp) ReplyImageMsg ¶
func (this *Weixinmp) ReplyImageMsg(rw http.ResponseWriter, mediaId string) error
reply image message
func (*Weixinmp) ReplyMusicMsg ¶
func (this *Weixinmp) ReplyMusicMsg(rw http.ResponseWriter, music *Music) error
reply music message
func (*Weixinmp) ReplyNewsMsg ¶
func (this *Weixinmp) ReplyNewsMsg(rw http.ResponseWriter, articles *[]Article) error
reply news message
func (*Weixinmp) ReplyTextMsg ¶
func (this *Weixinmp) ReplyTextMsg(rw http.ResponseWriter, content string) error
reply text message
func (*Weixinmp) ReplyVideoMsg ¶
func (this *Weixinmp) ReplyVideoMsg(rw http.ResponseWriter, video *Video) error
reply video message
func (*Weixinmp) ReplyVoiceMsg ¶
func (this *Weixinmp) ReplyVoiceMsg(rw http.ResponseWriter, mediaId string) error
reply voice message
func (*Weixinmp) SendImageMsg ¶
send image message
func (*Weixinmp) SendMusicMsg ¶
send music message
func (*Weixinmp) SendNewsMsg ¶
send news message
func (*Weixinmp) SendTextMsg ¶
send text message
func (*Weixinmp) SendVideoMsg ¶
send video message
func (*Weixinmp) SendVoiceMsg ¶
send voice message
Click to show internal directories.
Click to hide internal directories.