Versions in this module Expand all Collapse all v1 v1.0.1 Sep 17, 2021 Changes in this version + const MetadataAccessTokenKey + const MetadataJsAPITicketKey + const RedisAccessTokenKey + const RedisJsAPITicketKey + var AppID = "" + var AppSecret = "" + var ErrContextNotFoundClient = errors.New("上下文中没有获取到微信客户端") + var ErrMetadataNotFoundClient = errors.New("Metadata不存在客户端AccessToken") + func Decrypt(value string) ([]byte, string) + func Download(uri string, dis io.Writer) (result []byte, err error) + func Encrypt(value string) string + func Execute(url string, param Parameter) (json *simplejson.Json, err error) + func Get(url string, args map[string]string) (result []byte, err error) + func GetErrorMsg(code int) string + func NewContext(ctx context.Context, c Clienter) context.Context + func NewError(buf []byte) error + func Post(url, contentType string, args map[string]string) (result string, err error) + func PostJSON(url string, jsonObject interface{}) (result []byte, err error) + func Upload(uri, filename string, description *VideoDescription, srcFile io.Reader) (result []byte, err error) + type AccessTokenReply struct + AccessToken string + ExpiresIn int + type CDATA string + func (c CDATA) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (c CDATA) String() string + type Client struct + func NewClient(appID, appSecret string) *Client + func (c *Client) AppID() string + func (c *Client) AppSecret() string + func (c *Client) GetAccessToken() string + func (c *Client) GetJsAPITicket() string + type ClientFromRedis struct + func NewClientFromRedis(opts ...ClientFromRedisOption) *ClientFromRedis + func (client *ClientFromRedis) GetAccessToken() string + func (client *ClientFromRedis) GetJsAPITicket() string + type ClientFromRedisOption func(*ClientFromRedisOptions) + func ClientFromRedisOptionAccessTokenKey(accessTokenKey string) ClientFromRedisOption + func ClientFromRedisOptionJsAPITicketKey(jsAPITicketKey string) ClientFromRedisOption + func ClientFromRedisOptionRedisClient(client *redis.Client) ClientFromRedisOption + type ClientFromRedisOptions struct + AccessTokenKey string + JsAPITicketKey string + RedisClient *redis.Client + func NewClientFromRedisOptions(opts ...ClientFromRedisOption) ClientFromRedisOptions + type Clienter interface + GetAccessToken func() string + GetJsAPITicket func() string + func FromContext(ctx context.Context) (Clienter, error) + func FromMetadata(metadata map[string]string) (Clienter, error) + type Configer interface + AppID func() string + AppSecret func() string + type JSONer interface + JSON func() string + type JsAPITicketReply struct + ExpiresIn int + Ticket string + type Parameter map[string]string + type VideoDescription struct + Introduction string + Title string + type XMLer interface + XML func() string