Versions in this module Expand all Collapse all v0 v0.7.0 Feb 18, 2022 v0.6.0 Jan 13, 2022 Changes in this version type MenuButton + ArticleId string v0.5.0 Jan 13, 2022 Changes in this version + const EventClick + const EventLocation + const EventScan + const EventSubscribe + const EventTemplateSent + const EventUnsubscribe + const EventView + const MediaTypeImage + const MediaTypeThumb + const MediaTypeVideo + const MediaTypeVoice + const MenuButtonTypeKey + const MenuButtonTypeLocationSelect + const MenuButtonTypeMediaId + const MenuButtonTypeMiniProgram + const MenuButtonTypePicPhotoOrAlbum + const MenuButtonTypePicSysphoto + const MenuButtonTypePicWeixin + const MenuButtonTypeScancodePush + const MenuButtonTypeScancodeWaitmsg + const MenuButtonTypeUrl + const MenuButtonTypeViewLimited + const MsgTypeDefault + const MsgTypeEvent + const MsgTypeEventClick + const MsgTypeEventLocation + const MsgTypeEventScan + const MsgTypeEventSubscribe + const MsgTypeEventTemplateSent + const MsgTypeEventUnsubscribe + const MsgTypeEventView + const MsgTypeImage + const MsgTypeLink + const MsgTypeLocation + const MsgTypeShortVideo + const MsgTypeText + const MsgTypeVideo + const MsgTypeVoice + const RedirectURLScopeBasic + const RedirectURLScopeUserInfo + const TemplateSentStatusSuccess + const TemplateSentStatusSystemFailed + const TemplateSentStatusUserBlock + type AccessToken struct + Expires time.Time + Token string + type Article struct + Description string + PicUrl string + Title string + Url string + type CacheStore interface + Get func(k string) (AccessToken, error) + Set func(k string, v AccessToken) error + type HandlerFunc func(ResponseWriter, *Request) + type Material struct + Content struct{ ... } + CreateTime int64 + MediaId string + Name string + UpdateTime int64 + Url string + type Materials struct + ItemCount int + Items []Material + TotalCount int + type MemoryCacheStore struct + func NewMemoryCacheStore() *MemoryCacheStore + func (s *MemoryCacheStore) Get(k string) (AccessToken, error) + func (s *MemoryCacheStore) Set(k string, v AccessToken) error + type Menu struct + Buttons []MenuButton + type MenuButton struct + AppId string + Key string + MediaId string + Name string + PagePath string + SubButtons []MenuButton + Type string + Url string + type MessageHeader struct + CreateTime int + Encrypt string + FromUserName string + MsgType string + ToUserName string + type Music struct + Description string + HQMusicUrl string + MusicUrl string + ThumbMediaId string + Title string + type QRScene struct + ExpireSeconds int + Ticket string + Url string + func (qr *QRScene) ToURL() string + type RedisCacheStore struct + func NewRedisCacheStore(opt *RedisOptions) *RedisCacheStore + func (s *RedisCacheStore) Get(k string) (AccessToken, error) + func (s *RedisCacheStore) Set(k string, v AccessToken) error + type RedisOptions struct + Addrs []string + DBNum int + IsCluster bool + Password string + type Request struct + Content string + Description string + Event string + EventKey string + Format string + Label string + Latitude float32 + LocationX float32 + LocationY float32 + Longitude float32 + MediaId string + MsgId int64 + PicUrl string + Precision float32 + Recognition string + Scale float32 + Status string + ThumbMediaId string + Ticket string + Title string + Url string + type ResponseWriter interface + DownloadMedia func(mediaId string, writer io.Writer) error + DownloadMediaToFile func(mediaId string, filepath string) error + GetUserData func() interface{} + GetWeixin func() *Weixin + PostImage func(mediaId string) error + PostMusic func(music *Music) error + PostNews func(articles []Article) error + PostTemplateMessage func(templateid string, url string, data TmplData) (int32, error) + PostText func(text string) error + PostVideo func(mediaId string, title string, description string) error + PostVoice func(mediaId string) error + ReplyImage func(mediaId string) + ReplyMusic func(music *Music) + ReplyNews func(articles []Article) + ReplyOK func() + ReplyText func(text string) + ReplyVideo func(mediaId string, title string, description string) + ReplyVoice func(mediaId string) + TransferCustomerService func(serviceId string) + UploadMedia func(mediaType string, filename string, reader io.Reader) (string, error) + UploadMediaFromFile func(mediaType string, filepath string) (string, error) + type TmplData map[string]TmplItem + type TmplItem struct + Color string + Value string + type TmplMiniProgram struct + AppId string + PagePath string + type TmplMsg struct + Color string + Data TmplData + MiniProgram *TmplMiniProgram + TemplateId string + ToUser string + Url string + type UserAccessToken struct + AccessToken string + ExpireSeconds int + OpenId string + RefreshToken string + Scope string + UnionId string + type UserInfo struct + City string + Country string + GroupId int + HeadImageUrl string + Language string + Nickname string + OpenId string + Province string + Remark string + Sex int + Subscribe int + SubscribeTime int64 + UnionId string + type Weixin struct + func New(token string, appid string, secret string, cacheStore CacheStore) *Weixin + func NewWithUserData(token string, appid string, secret string, userData interface{}) *Weixin + func (wx *Weixin) AddTemplate(shortid string) (string, error) + func (wx *Weixin) BatchGetMaterial(materialType string, offset int, count int) (*Materials, error) + func (wx *Weixin) CreateHandlerFunc(w http.ResponseWriter, r *http.Request) http.HandlerFunc + func (wx *Weixin) CreateMenu(menu *Menu) error + func (wx *Weixin) CreateQRLimitScene(sceneID int) (*QRScene, error) + func (wx *Weixin) CreateQRLimitSceneByString(sceneStr string) (*QRScene, error) + func (wx *Weixin) CreateQRScene(sceneID int, expires int) (*QRScene, error) + func (wx *Weixin) CreateQRSceneByString(sceneStr string, expires int) (*QRScene, error) + func (wx *Weixin) CreateRedirectURL(urlStr string, scope string, state string) string + func (wx *Weixin) DeleteMenu() error + func (wx *Weixin) DownloadMedia(mediaID string, writer io.Writer) error + func (wx *Weixin) DownloadMediaToFile(mediaID string, fp string) error + func (wx *Weixin) GetAccessToken() AccessToken + func (wx *Weixin) GetAppId() string + func (wx *Weixin) GetAppSecret() string + func (wx *Weixin) GetIpList() ([]string, error) + func (wx *Weixin) GetJsAPITicket() (string, error) + func (wx *Weixin) GetMenu() (*Menu, error) + func (wx *Weixin) GetUserAccessToken(code string) (*UserAccessToken, error) + func (wx *Weixin) GetUserInfo(openid string) (*UserInfo, error) + func (wx *Weixin) HandleFunc(pattern string, handler HandlerFunc) + func (wx *Weixin) JsSignature(url string, timestamp int64, noncestr string) (string, error) + func (wx *Weixin) PostImage(touser string, mediaID string) error + func (wx *Weixin) PostMusic(touser string, music *Music) error + func (wx *Weixin) PostNews(touser string, articles []Article) error + func (wx *Weixin) PostTemplateMessage(touser string, templateid string, url string, data TmplData) (int32, error) + func (wx *Weixin) PostTemplateMessageMiniProgram(msg *TmplMsg) (int64, error) + func (wx *Weixin) PostText(touser string, text string) error + func (wx *Weixin) PostVideo(touser string, m string, t string, d string) error + func (wx *Weixin) PostVoice(touser string, mediaID string) error + func (wx *Weixin) RefreshAccessToken() + func (wx *Weixin) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (wx *Weixin) SetDefaultHandler(fn HandlerFunc) + func (wx *Weixin) SetEncodingAESKey(key string) error + func (wx *Weixin) SetTemplateIndustry(id1 string, id2 string) error + func (wx *Weixin) ShortURL(url string) (string, error) + func (wx *Weixin) UploadMedia(mediaType string, filename string, reader io.Reader) (string, error) + func (wx *Weixin) UploadMediaFromFile(mediaType string, fp string) (string, error)