Versions in this module Expand all Collapse all v1 v1.0.0 Nov 10, 2022 Changes in this version + const SignTypeHMACSHA256 + const SignTypeMD5 + func AESDecryptMsg(ciphertext []byte, aesKey []byte) (random, rawXMLMsg, appID []byte, err error) + func AESEncryptMsg(random, rawXMLMsg []byte, appID string, aesKey []byte) (ciphertext []byte) + func AesECBDecrypt(ciphertext []byte, aesKey []byte) ([]byte, error) + func CalculateSign(content, signType, key string) (string, error) + func DecodeWithCommonError(response []byte, apiName string) (err error) + func DecodeWithError(response []byte, obj interface{}, apiName string) error + func DecryptMsg(appID, encryptedMsg, aesKey string) (random, rawMsgXMLBytes []byte, err error) + func EncryptMsg(random, rawXMLMsg []byte, appID, aesKey string) (encrtptMsg []byte, err error) + func GetCurrTS() int64 + func HTTPGet(uri string) ([]byte, error) + func HTTPGetContext(ctx context.Context, uri string) ([]byte, error) + func HTTPPost(uri string, data string) ([]byte, error) + func HTTPPostContext(ctx context.Context, uri string, data []byte, header map[string]string) ([]byte, error) + func NewECBDecryptor(b cipher.Block) cipher.BlockMode + func NewECBEncryptor(b cipher.Block) cipher.BlockMode + func OrderParam(p map[string]string, bizKey string) (returnStr string) + func PKCS5Padding(ciphertext []byte, blockSize int) []byte + func PKCS5UnPadding(origData []byte) []byte + func ParamSign(p map[string]string, key string) (string, error) + 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 RSADecrypt(privateKey string, ciphertext []byte) ([]byte, error) + func RSADecryptBase64(privateKey string, cryptoText string) ([]byte, error) + func RandomStr(length int) string + func Signature(params ...string) string + func SliceChunk(src []string, chunkSize int) (chunks [][]string) + type CommonError struct + ErrCode int64 + ErrMsg string + func NewCommonError(apiName string, code int64, msg string) *CommonError + func (c *CommonError) Error() string + type ECBDecryptor ecb + func (x *ECBDecryptor) BlockSize() int + func (x *ECBDecryptor) CryptBlocks(dst, src []byte) + type ECBEncryptor ecb + func (x *ECBEncryptor) BlockSize() int + func (x *ECBEncryptor) CryptBlocks(dst, src []byte) + type MultipartFormField struct + Fieldname string + Filename string + IsFile bool + Value []byte