Documentation
¶
Index ¶
- Variables
- func AESDecryptMsg(ciphertext []byte, aesKey []byte) (random, rawXMLMsg, appID []byte, err error)
- func AESEncryptMsg(random, rawXMLMsg []byte, appID string, aesKey []byte) (ciphertext []byte)
- func Bool(v bool) *bool
- func DecodeWithCommonError(response []byte, apiName string) (err error)
- func DecodeXMLToMap(r io.Reader) (m map[string]string, err error)
- func DecryptMsg(appID, encryptedMsg, aesKey string) (random, rawMsgXMLBytes []byte, err error)
- func EncodeXMLFromMap(w io.Writer, m map[string]string, rootname string) (err error)
- func EncryptMsg(random, rawXMLMsg []byte, appID, aesKey string) (encrtptMsg []byte, err error)
- func Float32(v float32) *float32
- func Float64(v float64) *float64
- func GetCurrTs() int64
- func HTTPGet(uri string) ([]byte, error)
- func HttpResponseWriter(w io.Writer) http.ResponseWriter
- func Int(v int) *int
- func Int32(v int32) *int32
- func Int64(v int64) *int64
- func MD5Sum(txt string) (sum string)
- func NonceStr() string
- func PostFile(fieldname, filename, uri string) ([]byte, error)
- func PostJSON(uri string, obj interface{}) ([]byte, error)
- func PostJSONWithRespContentType(uri string, obj interface{}) ([]byte, string, error)
- func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
- func PostXML(uri string, obj interface{}) ([]byte, error)
- func PostXMLWithTLS(uri string, obj interface{}, ca, key string) ([]byte, error)
- func RandomStr(length int) string
- func Signature(params ...string) string
- func String(v string) *string
- func Uint32(v uint32) *uint32
- func Uint64(v uint64) *uint64
- type CommonError
- type MultipartFormField
Constants ¶
This section is empty.
Variables ¶
var BeijingLocation = time.FixedZone("Asia/Shanghai", 8*60*60)
var DefaultHttpClient *http.Client
var DefaultMediaHttpClient *http.Client
Functions ¶
func AESDecryptMsg ¶
AESDecryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId] 参考:github.com/chanxuehong/wechat.v2
func AESEncryptMsg ¶
AESEncryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId] 参考:github.com/chanxuehong/wechat.v2
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func DecodeWithCommonError ¶
DecodeWithCommonError 将返回值按照CommonError解析
func DecodeXMLToMap ¶
DecodeXMLToMap decodes xml reading from io.Reader and returns the first-level sub-node key-value set, if the first-level sub-node contains child nodes, skip it.
func DecryptMsg ¶
DecryptMsg 消息解密
func EncodeXMLFromMap ¶
EncodeXMLFromMap encodes map[string]string to io.Writer with xml format.
NOTE: This function requires the rootname argument and the keys of m (type map[string]string) argument are legitimate xml name string that does not contain the required escape character!
func EncryptMsg ¶
EncryptMsg 加密消息
func Float32 ¶
Float32 is a helper routine that allocates a new float32 value to store v and returns a pointer to it.
func Float64 ¶
Float64 is a helper routine that allocates a new float64 value to store v and returns a pointer to it.
func HttpResponseWriter ¶
func HttpResponseWriter(w io.Writer) http.ResponseWriter
将 io.Writer 从语义上实现 http.ResponseWriter.
func Int ¶
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
func Int32 ¶
Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it.
func Int64 ¶
Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.
func PostJSONWithRespContentType ¶
PostJSONWithRespContentType post json数据请求,且返回数据类型
func PostMultipartForm ¶
func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
PostMultipartForm 上传文件或其他多个字段
func PostXMLWithTLS ¶
PostXMLWithTLS perform a HTTP/POST request with XML body and TLS
func String ¶
String is a helper routine that allocates a new string value to store v and returns a pointer to it.
Types ¶
type CommonError ¶
CommonError 微信返回的通用错误json