Documentation ¶
Overview ¶
加解密方法
公共方法
签名
时间日期相关方法
Index ¶
- Constants
- func AESDecryptMsg(ciphertext []byte, aesKey []byte) (random, rawXMLMsg, appID []byte, err error)
- func AESEncryptMsg(random, rawXMLMsg []byte, appID string, aesKey []byte) (ciphertext []byte)
- func ArrayDefault(str *[]string, defaultArray []string)
- func Base64URLDecode(data string) ([]byte, error)
- func Base64UrlSafeEncode(source []byte) string
- func BoolDefault(str *bool, defaultBool bool)
- func DecryptMsg(appID, encryptedMsg, aesKey string) (random, rawMsgXMLBytes []byte, err error)
- func EncryptMsg(random, rawXMLMsg []byte, appID, aesKey string) (encryptMsg []byte, err error)
- func GetCurTs() int64
- func HTTPGet(uri string, proxyAddr string) ([]byte, error)
- func Int64Default(str *int64, defaultInt64 int64)
- func Int8Default(str *int8, defaultInt int8)
- func IntDefault(str *int, defaultInt int)
- func LevelDefault(str *flog.LEVEL, defaultLevel flog.LEVEL)
- func MD5Sum(txt string) (sum string)
- func Mkdir(dir string) (e error)
- func PostFile(fieldname, filename, uri, proxyAddr string) (respBody []byte, err error)
- func PostJSON(uri string, obj interface{}, proxyAddr string) ([]byte, error)
- func PostMultipartForm(fields []MultipartFormField, uri string, proxyAddr string) (respBody []byte, err error)
- func RandomString(lenth int) string
- func SHA1(str string) string
- func Signature(params ...string) string
- func StrDefault(str *string, defaultStr string)
- func URLKVString(m map[string]string) (s string)
- type MultipartFormField
- type WxError
Constants ¶
View Source
const ( ErrCodeOK = 0 ErrCodeInvalidCredential = 40001 // access_token 过期错误码 ErrCodeAccessTokenExpired = 42001 // access_token 过期错误码 )
Variables ¶
This section is empty.
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 ArrayDefault ¶
func Base64URLDecode ¶
func Base64UrlSafeEncode ¶
func BoolDefault ¶
func DecryptMsg ¶
消息解密
func EncryptMsg ¶
加密消息
func Int64Default ¶
func Int8Default ¶
func IntDefault ¶
func PostMultipartForm ¶
func PostMultipartForm(fields []MultipartFormField, uri string, proxyAddr string) (respBody []byte, err error)
PostMultipartForm 上传文件或其他多个字段
func RandomString ¶
func StrDefault ¶
func URLKVString ¶
Types ¶
type MultipartFormField ¶
MultipartFormField 保存文件或其他字段信息
Source Files ¶
Click to show internal directories.
Click to hide internal directories.