Versions in this module Expand all Collapse all v0 v0.0.1 Dec 17, 2015 Changes in this version + const AccountCreateQRCodeURL + const AccountGetQRCodeImgAddrURL + const CustomAddURL + const CustomDeleteURL + const CustomHeadingURL + const CustomListURL + const CustomMsgURL + const CustomUpdateURL + const LangEN + const LangZHCN + const LangZHTW + const MaterialAddNewsURL + const MaterialBatchGetNewsURL + const MaterialCountURL + const MaterialDeleteNewsURL + const MaterialGetNewsURL + const MaterialGetTemporaryURL + const MaterialUpdateNewsURL + const MaterialUploadImg + const MaterialUploadNewsURL + const MaterialUploadTemporaryURL + const MenuCreateConditionalURL + const MenuCreateURL + const MenuDeleteConditionalURL + const MenuDeleteURL + const MenuGetURL + const MenuInfoURL + const MenuTryMatchConditionalMenuURL + const MenuTypeClick + const MenuTypeLocationSelect + const MenuTypeMediaId + const MenuTypePicPhotoOrAlbum + const MenuTypePicSysphoto + const MenuTypePicWeixin + const MenuTypeScancodePush + const MenuTypeScancodeWaitmsg + const MenuTypeView + const MenuTypeViewLimited + const ScopeSNSAPIBase + const ScopeSNSAPIUserInfo + const ShortURLLongURL2ShortURL + const TamplateSetIndustryURL + const TemplateAddTemplateURL + const TemplateSendTemplateMsgURL + const UserGroupBatchUpdateMemberGroupURL + const UserGroupCreateURL + const UserGroupDeleteURL + const UserGroupGetAllURL + const UserGroupGetGroupIdURL + const UserGroupUpdateMemberGroupURL + const UserGroupUpdateURL + const UserInfoBatchGetUserInfoURL + const UserInfoGetUserInfoURL + const UserInfoGetUserListURL + const UserInfoUpdateRemarkURL + const UserWebCheckWebTokenURL + const UserWebGetWebUserInfoURL + const UserWebRedirectURL + const UserWebRefreshTokenURL + const UserWebWebTokenURL + const WeixinErrCodeSuccess + const WeixinErrCodeSystemBusy + var AccessToken func() string + var AppId string + var AppSecret string + var EncodingAESKey []byte + var EventAnnualRenewHandler func(*EventAnnualRenew) ReplyMsg + var EventClickHandler func(*EventClick) ReplyMsg + var EventDefaultHandler = func(msg *Message) (reply ReplyMsg) + var EventLocationHandler func(*EventLocation) ReplyMsg + var EventLocationSelectHandler func(*EventLocationSelect) ReplyMsg + var EventNamingVerifyFailHandler func(*EventNamingVerifyFail) ReplyMsg + var EventNamingVerifySuccessHandler func(*EventNamingVerifySuccess) ReplyMsg + var EventPicPhotoOrAlbumHandler func(*EventPicPhotoOrAlbum) ReplyMsg + var EventPicSysphotoHandler func(*EventPicSysphoto) ReplyMsg + var EventPicWeixinHandler func(*EventPicWeixin) ReplyMsg + var EventQualificationVerifyFailHandler func(*EventQualificationVerifyFail) ReplyMsg + var EventQualificationVerifySuccessHandler func(*EventQualificationVerifySuccess) ReplyMsg + var EventScancodePushHandler func(*EventScancodePush) ReplyMsg + var EventScancodeWaitmsgHandler func(*EventScancodeWaitmsg) ReplyMsg + var EventSubscribeHandler func(*EventSubscribe) ReplyMsg + var EventTemplateSendJobFinishHandler func(*EventTemplateSendJobFinish) ReplyMsg + var EventUnsubscribeHandler func(*EventSubscribe) ReplyMsg + var EventVerifyExpiredHandler func(*EventVerifyExpired) ReplyMsg + var EventViewHandler func(*EventView) ReplyMsg + var OriginId string + var RecvDefaultHandler = func(msg *Message) (reply ReplyMsg) + var RecvImageHandler func(*RecvImage) ReplyMsg + var RecvLinkHandler func(*RecvLink) ReplyMsg + var RecvLocationHandler func(*RecvLocation) ReplyMsg + var RecvShortVideoHandler func(*RecvVideo) ReplyMsg + var RecvTextHandler func(*RecvText) ReplyMsg + var RecvVideoHandler func(*RecvVideo) ReplyMsg + var RecvVoiceHandler func(*RecvVoice) ReplyMsg + var Token string + func AESCBCDecrypt(enc, key, iv []byte) (src []byte, err error) + func AESCBCEncrypt(src, key, iv []byte) (enc []byte, err error) + func AddCustom(account, nickname, password string) (err error) + func AddCustomStruct(cust *Custom) (err error) + func AddNews(as []Article) (mediaId string, err error) + func AddTemplate(shortId string) (templateId string, err error) + func BatchUpdateMemberGroup(openIds []string, toGroupId int) (err error) + func CheckSignature(token, timestamp, nonce, encrypt, sign string) bool + func CheckWebToken(webToken, openId string) (err error) + func CreateConditionalMenu(cm *ConditionalMenu) (menuId string, err error) + func CreateMenu(buttons []Button) (err error) + func DecryptMsg(b64Enc string, aesKey []byte, appId string) (msg []byte, err error) + func DeleteConditionalMenu(menuId int) (err error) + func DeleteCustom(account, nickname, password string) (err error) + func DeleteCustomStruct(cust *Custom) (err error) + func DeleteMenu() (err error) + func DeleteNews(mediaId string) (err error) + func DeleteUserGroup(groupId int) (err error) + func EncryptMsg(msg []byte, aesKey []byte, appId string) (b64Enc string, err error) + func GenRedirectURL(redirectURL string, scope ScopeSNSAPI, state ...string) string + func GetGroupIdByOpenId(openId string) (groupId int, err error) + func GetQRCodeImg(ticket string) string + func GetTemporaryMaterial(mediaId string) (filename string, body []byte, err error) + func GetUnmarshal(url string, ret interface{}) (err error) + func GetUserList(fromOpenId ...string) (openIds []string, total, count int, nextOpenId string, err error) + func HandleAccess(w http.ResponseWriter, r *http.Request) + func Initialize(originId, appId, appSecret, token, encodingAESKey string) + func LongURL2Short(longURL string) (shortURL string, err error) + func PKCS7Padding(src []byte, k int) (padded []byte) + func PKCS7UnPadding(src []byte) (padded []byte) + func ParseFullMsg(fullMsg []byte) (randBytes []byte, msgLen int, msg []byte, appId string) + func Post(url string, js []byte) (err error) + func PostMarshal(url string, v interface{}) (err error) + func PostMarshalUnmarshal(url string, v interface{}, ret interface{}) (err error) + func PostUnmarshal(url string, js []byte, ret interface{}) (err error) + func RandBytes(size int) (r []byte) + func RefreshAccessToken(appId, appSecret string) + func SendCustomMsg(openId string, msg CustMsg) (err error) + func SendTemplateMsg(m *TemplateMsg) (msgId int, err error) + func SetIndustry(primary, secondary int) error + func Signature(token, timestamp, nonce, encrypt string) string + func SpliceFullMsg(msg []byte, appId string) (fullMsg []byte) + func UpdateCustom(account, nickname, password string) (err error) + func UpdateCustomStruct(cust *Custom) (err error) + func UpdateMemberGroup(openId string, toGroupId int) (err error) + func UpdateNews(news *UpdateNewsReq) (err error) + func UpdateUserRemark(openId, remark string) (err error) + func Upload(url, fieldName string, file *os.File, ret interface{}, desc ...string) (err error) + func UploadHeading(account string, file *os.File) (err error) + func UploadImg(file *os.File) (u string, err error) + func UploadNews(mtype MediaType, file *os.File) (mediaId, u string, err error) + func UploadTemporaryMaterial(mtype MediaType, file *os.File) (mediaId string, createAt int, err error) + func UploadVideo(mtype MediaType, title, desc string, file *os.File) (mediaId, u string, err error) + func ValidateURL(token, timestamp, nonce, signature string) bool + type Account struct + Account string + AccountId string + HeadImgURL string + NickName string + func GetCustomList() (accs []Account, err error) + type AllMenu struct + ConditionalMenu struct{ ... } + Menu struct{ ... } + func GetMenu() (all *AllMenu, err error) + type Article struct + Author string + Content string + ContentSourceURL string + Digest string + ShowCoverPic int + ThumbMediaId string + Title string + URL string + type Button struct + Key string + Name string + SubButton []Button + Type MenuType + URL string + func TryMatchConditionalMenu(userId string) (buttons []Button, err error) + type ConditionalMenu struct + Button []Button + MatchRule MatchRule + type CustImage struct + MediaId string + type CustMsg interface + type CustMusic struct + Description string + HQMusicURL string + MusicURL string + ThumbMediaId string + Title string + type CustNewsArticle struct + Description string + PicURL string + Title string + URL string + type CustText struct + Content string + type CustVideo struct + Description string + MediaId string + ThumbMediaId string + Title string + type CustVoice struct + MediaId string + type CustWXCard struct + CardExt string + CardId string + type Custom struct + Account string + NickName string + Password string + type CustomList struct + List []Account + type EncMessage struct + Encrypt string + MsgSignature string + Nonce string + TimeStamp string + ToUserName string + XMLName xml.Name + type EventAnnualRenew struct + ExpiredTime int + func NewEventAnnualRenew(m *Message) *EventAnnualRenew + type EventBase struct + CreateTime string + Event EventType + FromUserName string + MsgType MsgType + ToUserName string + type EventClick struct + EventKey string + func NewEventClick(m *Message) *EventClick + type EventLocation struct + Latitude float64 + Longitude float64 + Precision float64 + func NewEventLocation(m *Message) *EventLocation + type EventLocationSelect struct + EventKey string + Label string + LocationX float64 + LocationY float64 + Poiname string + Scale int + func NewEventLocationSelect(m *Message) *EventLocationSelect + type EventNamingVerifyFail struct + FailReason string + FailTime int + func NewEventNamingVerifyFail(m *Message) *EventNamingVerifyFail + type EventNamingVerifySuccess struct + ExpiredTime int + func NewEventNamingVerifySuccess(m *Message) *EventNamingVerifySuccess + type EventPicPhotoOrAlbum struct + Count int + EventKey string + PicMd5Sums []string + func NewEventPicPhotoOrAlbum(m *Message) *EventPicPhotoOrAlbum + type EventPicSysphoto struct + Count int + EventKey string + PicMd5Sums []string + func NewEventPicSysphoto(m *Message) *EventPicSysphoto + type EventPicWeixin struct + Count int + EventKey string + PicMd5Sums []string + func NewEventPicWeixin(m *Message) *EventPicWeixin + type EventQualificationVerifyFail struct + FailReason string + FailTime int + func NewEventQualificationVerifyFail(m *Message) *EventQualificationVerifyFail + type EventQualificationVerifySuccess struct + ExpiredTime int + func NewEventQualificationVerifySuccess(m *Message) *EventQualificationVerifySuccess + type EventScancodePush struct + EventKey string + ScanResult string + ScanType string + func NewEventScancodePush(m *Message) *EventScancodePush + type EventScancodeWaitmsg struct + EventKey string + ScanResult string + ScanType string + func NewEventScancodeWaitmsg(m *Message) *EventScancodeWaitmsg + type EventSubscribe struct + EventKey string + Ticket string + func NewEventSubscribe(m *Message) *EventSubscribe + type EventTemplateSendJobFinish struct + MsgID int + Status string + func NewEventTemplateSendJobFinish(m *Message) *EventTemplateSendJobFinish + type EventType string + const EventTypeAnnualRenew + const EventTypeClick + const EventTypeLocation + const EventTypeLocationSelect + const EventTypeNamingVerifyFail + const EventTypeNamingVerifySuccess + const EventTypePicPhotoOrAlbum + const EventTypePicSysphoto + const EventTypePicWeixin + const EventTypeQualificationVerifyFail + const EventTypeQualificationVerifySuccess + const EventTypeScancodePush + const EventTypeScancodeWaitmsg + const EventTypeSubscribe + const EventTypeTemplateSendJobFinish + const EventTypeUnsubscribe + const EventTypeVerifyExpired + const EventTypeView + type EventVerifyExpired struct + ExpiredTime int + func NewEventVerifyExpired(m *Message) *EventVerifyExpired + type EventView struct + EventKey string + func NewEventView(m *Message) *EventView + type Group struct + Count int + Id int + Name string + func CreateUserGroup(name string) (g *Group, err error) + func GetAllUserGroups() (gs []Group, err error) + func UpdateUserGroup(id int, name string) (g *Group, err error) + type GroupIdWapper struct + GroupId int + type GroupWapper struct + Group Group + type GroupsWapper struct + Groups []Group + type KeywordPair struct + Color string + Value string + type Lang string + type MatchRule struct + City string + ClientPlatformType int + Country string + GroupId int + Province string + Sex int + type MaterialCount struct + ImageCount int + NewsCount int + VideoCount int + VoiceCount int + func GetMaterialCount() (mc *MaterialCount, err error) + type MediaType string + const MediaTypeImage + const MediaTypeThumb + const MediaTypeVideo + const MediaTypeVoice + type MenuInfo struct + IsMenuOpen int + SelfmenuInfo struct{ ... } + func GetMenuInfo() (mi *MenuInfo, err error) + type MenuType string + type Message struct + Content string + Count int + CreateTime string + Description string + Encrypt string + Event EventType + EventKey string + ExpiredTime int + FailReason string + FailTime int + Format string + FromUserName string + Label string + Label2 string + Latitude float64 + LocationX float64 + LocationX2 float64 + LocationY float64 + LocationY2 float64 + Longitude float64 + MediaId string + MsgId int + MsgType MsgType + PicMd5Sums []string + PicUrl string + Poiname string + Precision float64 + Recongnition string + Scale int + Scale2 int + ScanResult string + ScanType string + Status string + ThumbMediaId string + Ticket string + Title string + ToUserName string + TplMsgId int + Url string + XMLName xml.Name + type MsgType string + const MsgTypeEvent + const MsgTypeImage + const MsgTypeLink + const MsgTypeLocation + const MsgTypeMusic + const MsgTypeNews + const MsgTypeShortVideo + const MsgTypeText + const MsgTypeVideo + const MsgTypeVoice + const MsgTypeWXCard + type News struct + Description string + DownURL string + NewsItem []Article + Title string + func GetNews(mediaId string) (ret *News, err error) + type NewsList struct + Item []struct{ ... } + ItemCount string + TotalCount string + func BatchGetNews(mtype MediaType, offset int, count int) (ret *NewsList, err error) + type QRCodeTicket struct + ExpireSeconds int + Ticket string + URL string + func CreatePermanentQRCodeTicket(sceneId int) (ticket *QRCodeTicket, err error) + func CreatePermanentQRCodeTicketString(sceneId string) (ticket *QRCodeTicket, err error) + func CreateTemporaryQRCodeTicket(sceneId int, expireSeconds ...int) (ticket *QRCodeTicket, err error) + type RecvEvent interface + func NewRecvEvent(msg *Message) RecvEvent + type RecvImage struct + CreateTime string + FromUserName string + MediaId string + MsgId int + MsgType MsgType + PicUrl string + ToUserName string + func NewRecvImage(m *Message) *RecvImage + type RecvLink struct + CreateTime string + Description string + FromUserName string + MsgId int + MsgType MsgType + Title string + ToUserName string + Url string + func NewRecvLink(m *Message) *RecvLink + type RecvLocation struct + CreateTime string + FromUserName string + Label string + LocationX float64 + LocationY float64 + MsgId int + MsgType MsgType + Scale int + ToUserName string + func NewRecvLocation(m *Message) *RecvLocation + type RecvMsg interface + func NewRecvMsg(msg *Message) RecvMsg + type RecvText struct + Content string + CreateTime string + FromUserName string + MsgId int + MsgType MsgType + ToUserName string + func NewRecvText(m *Message) *RecvText + type RecvVideo struct + CreateTime string + FromUserName string + MediaId string + MsgId int + MsgType MsgType + ThumbMediaId string + ToUserName string + func NewRecvVideo(m *Message) *RecvVideo + type RecvVoice struct + CreateTime string + Format string + FromUserName string + MediaId string + MsgId int + MsgType MsgType + Recongnition string + ToUserName string + func NewRecvVoice(m *Message) *RecvVoice + type ReplyArticle struct + Description string + PicUrl string + Title string + Url string + type ReplyBase struct + MsgType MsgType + func (b *ReplyBase) SetMsgType(msgType MsgType) + type ReplyImage struct + CreateTime string + FromUserName string + MediaId string + PicUrl string + ToUserName string + XMLName xml.Name + type ReplyMsg interface + SetMsgType func(msgType MsgType) + func HandleEvent(msg *Message) (reply ReplyMsg) + func HandleMessage(msg *Message) (ret ReplyMsg) + type ReplyMusic struct + CreateTime string + Description string + FromUserName string + HQMusicUrl string + MusicURL string + ThumbMediaId string + Title string + ToUserName string + XMLName xml.Name + type ReplyNews struct + ArticleCount int + Articles []ReplyArticle + CreateTime string + FromUserName string + ToUserName string + XMLName xml.Name + type ReplyText struct + Content string + CreateTime string + FromUserName string + ToUserName string + XMLName xml.Name + type ReplyVideo struct + CreateTime string + Description string + FromUserName string + MediaId string + Title string + ToUserName string + XMLName xml.Name + type ReplyVoice struct + CreateTime string + FromUserName string + MediaId string + ToUserName string + XMLName xml.Name + type ScopeSNSAPI string + type TemplateData struct + First KeywordPair + Keyword1 KeywordPair + Keyword2 KeywordPair + Keyword3 KeywordPair + Keyword4 KeywordPair + Keyword5 KeywordPair + Remark KeywordPair + type TemplateId struct + TemplateId string + type TemplateMsg struct + Data TemplateData + TemplateId string + ToUser string + URL string + type TempplateMsgId struct + MsgId int + type UpdateNewsReq struct + Articles []Article + Index string + MediaId string + type UserInfo struct + City string + Country string + GroupId int + HeadImgURL string + Language Lang + NickName string + OpenId string + Province string + Remark string + Sex int + Subscribe int + SubscribeTime int + UnionId string + func BatchGetUserInfo(openIds []string, lang ...Lang) (infos []UserInfo, err error) + func GetUserInfo(openId string, lang ...Lang) (info *UserInfo, err error) + type WebToken struct + AccessToken string + ExpiresIn int + OpenId string + RefreshToken string + Scope string + UnionId string + func GetWebToken(code string) (token *WebToken, err error) + func RefreshWebToken(refreshToken string) (token *WebToken, err error) + type WebUserInfo struct + City string + Country string + HeadImgURL string + NickName string + OpenId string + Privilege []string + Province string + Sex int + UnionId string + func GetWebUserInfo(webToken, openId string, lang ...Lang) (info *WebUserInfo, err error) + type WeixinError struct + ErrCode int + ErrMsg string + func (e *WeixinError) Error() string + func (e *WeixinError) GetWeixinError() *WeixinError + type WeixinErrorer interface + GetWeixinError func() *WeixinError