Documentation
¶
Index ¶
- Constants
- 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 GetCurrStr() string
- func GetCurrTS() int64
- func GetCurrTSStr() string
- func HTTPGet(uri string) ([]byte, error)
- func HTTPPost(uri string, data string) ([]byte, error)
- func Interface2String(inter interface{}) (str string)
- func NewHTTPPost(uri string, data string) ([]byte, error)
- func OrderParam(p map[string]string, bizKey string) (returnStr string)
- 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)
- type CommonError
- type CommonReq
- type MultipartFormField
Constants ¶
View Source
const ( SignTypeMD5 = `MD5` SignTypeHMACSHA256 = `HMAC-SHA256` )
View Source
const ( HTTP_TEST_WEB_URL = "http://css.pekcbec.com/css" HTTP_BASE_WEB_URL = "http://css.ubonex.com" )
Variables ¶
This section is empty.
Functions ¶
func CalculateSign ¶
CalculateSign compute sign
func DecodeWithCommonError ¶
DecodeWithCommonError 将返回值按照CommonError解析
func DecodeWithError ¶
DecodeWithError 将返回值按照解析
func Interface2String ¶
func Interface2String(inter interface{}) (str string)
func OrderParam ¶
OrderParam trade params
func PostJSONWithRespContentType ¶
PostJSONWithRespContentType post json data request,and return data type
func PostMultipartForm ¶
func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
PostMultipartForm upload file or other multi field
Types ¶
type CommonError ¶
type CommonError struct { Success bool `json:"success"` RetCode string `json:"retCode"` RetMsg string `json:"retMsg"` }
CommonError hongyuan return common error json
type CommonReq ¶
type CommonReq struct { Version string `json:"version"` //版本号 version String 是 2.0 EnteCode string `json:"enteCode"` //CSS内部定义企业代码。网易客户该字段需带网易merchantId值。 Timestamp string `json:"timestamp"` //yyyy-MM-ddHH:mm:ss Sign string `json:"sign"` //MD5签名的明文结构:enteCode=1111&orderNo=11111×tamp=2016-01-01 12:00:00 }
Click to show internal directories.
Click to hide internal directories.