Versions in this module Expand all Collapse all v1 v1.0.0 May 12, 2023 Changes in this version + const ErrCodeAccessTokenExpired + const ErrCodeInvalidCredential + const ErrCodeOK + type AccessTokenServer interface + IID01332E16DF5011E5A9D5A4DB30FED8E1 func() + RefreshToken func(currentToken string) (token string, err error) + Token func() (token string, err error) + type BinaryResult struct + Binary []byte + ContentType string + type Client struct + HttpClient *http.Client + func NewClient(srv AccessTokenServer, clt *http.Client) *Client + func (clt *Client) GetJSON(incompleteURL string, response interface{}) (err error) + func (clt *Client) GetJSONBinary(incompleteURL string, response *BinaryResult) (err error) + func (clt *Client) PostJSON(incompleteURL string, request interface{}, response interface{}) (err error) + func (clt *Client) PostJSONBinary(incompleteURL string, request interface{}, response *BinaryResult) (err error) + func (clt *Client) PostMultipartForm(incompleteURL string, fields []MultipartFormField, response interface{}) (err error) + type Context struct + AESKey []byte + AppId string + EncryptType string + MixedMsg *MixedMsg + MsgCiphertext []byte + MsgPlaintext []byte + MsgSignature string + Nonce string + QueryParams url.Values + Random []byte + Request *http.Request + ResponseWriter http.ResponseWriter + Signature string + Timestamp int64 + Token string + func (ctx *Context) AESResponse(msg interface{}, timestamp int64, nonce string, random []byte) (err error) + func (ctx *Context) Abort() + func (ctx *Context) Get(key string) (value interface{}, exists bool) + func (ctx *Context) IsAborted() bool + func (ctx *Context) MustGet(key string) interface{} + func (ctx *Context) Next() + func (ctx *Context) NoneResponse() (err error) + func (ctx *Context) RawResponse(msg interface{}) (err error) + func (ctx *Context) Set(key string, value interface{}) + func (ctx *Context) SetHandlers(handlers HandlerChain) + type DefaultAccessTokenServer struct + func NewDefaultAccessTokenServer(appId, appSecret string, httpClient *http.Client) (srv *DefaultAccessTokenServer) + func (srv *DefaultAccessTokenServer) IID01332E16DF5011E5A9D5A4DB30FED8E1() + func (srv *DefaultAccessTokenServer) RefreshToken(currentToken string) (token string, err error) + func (srv *DefaultAccessTokenServer) SetVerifyTicket(ticket string) error + func (srv *DefaultAccessTokenServer) Token() (token string, err error) + type Error struct + ErrCode int64 + ErrMsg string + func (err *Error) Error() string + type ErrorHandler interface + ServeError func(http.ResponseWriter, *http.Request, error) + var DefaultErrorHandler ErrorHandler = ErrorHandlerFunc(defaultErrorHandlerFunc) + type ErrorHandlerFunc func(http.ResponseWriter, *http.Request, error) + func (fn ErrorHandlerFunc) ServeError(w http.ResponseWriter, r *http.Request, err error) + type EventType string + type Handler interface + ServeMsg func(*Context) + type HandlerChain []Handler + type HandlerFunc func(*Context) + func (fn HandlerFunc) ServeMsg(ctx *Context) + type InfoType string + type MixedMsg struct + AppId string + AroundBeacons []struct{ ... } + BizMsgMenuId *int + ChosenBeacon ... + Content string + Description string + EventKey string + EventType EventType + Format string + Label string + Latitude float64 + LocationX float64 + LocationY float64 + Longitude float64 + MediaId string + MenuId int64 + MsgID int64 + MsgId int64 + PagePath string + PicURL string + Precision float64 + Recognition string + Scale int + ScanCodeInfo ... + SendLocationInfo ... + SendPicsInfo ... + SessionFrom string + Status string + ThumbMediaId string + ThumbUrl string + Ticket string + Title string + URL string + XMLName struct{} + type MsgHeader struct + CreateTime int64 + FromUserName string + MsgType MsgType + ToUserName string + type MsgType string + type MultipartFormField struct + FileName string + IsFile bool + Name string + Value io.Reader + type ServeMux struct + func NewServeMux() *ServeMux + func (mux *ServeMux) DefaultEventHandle(handlers ...Handler) + func (mux *ServeMux) DefaultEventHandleFunc(handlers ...func(*Context)) + func (mux *ServeMux) DefaultMsgHandle(handlers ...Handler) + func (mux *ServeMux) DefaultMsgHandleFunc(handlers ...func(*Context)) + func (mux *ServeMux) EventHandle(eventType EventType, handlers ...Handler) + func (mux *ServeMux) EventHandleFunc(eventType EventType, handlers ...func(*Context)) + func (mux *ServeMux) MsgHandle(msgType MsgType, handlers ...Handler) + func (mux *ServeMux) MsgHandleFunc(msgType MsgType, handlers ...func(*Context)) + func (mux *ServeMux) ServeMsg(ctx *Context) + func (mux *ServeMux) Use(middlewares ...Handler) + func (mux *ServeMux) UseForEvent(middlewares ...Handler) + func (mux *ServeMux) UseForMsg(middlewares ...Handler) + func (mux *ServeMux) UseFunc(middlewares ...func(*Context)) + func (mux *ServeMux) UseFuncForEvent(middlewares ...func(*Context)) + func (mux *ServeMux) UseFuncForMsg(middlewares ...func(*Context)) + type Server struct + func NewServer(oriId, appId, token, base64AESKey string, handler Handler, ...) (srv *Server) + func (srv *Server) AppId() string + func (srv *Server) OriId() string + func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request, ctxData map[string]interface{}, ...) + func (srv *Server) SetAESKey(base64AESKey string) (err error) + func (srv *Server) SetToken(token string) (err error) + type WeappAudit struct + DelayTime int + FailTime int + Reason string + ScreenShot string + SuccTime int