Versions in this module Expand all Collapse all v0 v0.2.0 Dec 5, 2022 Changes in this version + const PEM_BEGIN + const PEM_END + var ShangHaiTimeLocation = time.LoadLocation("Asia/Shanghai") + func DecodeWithError(responseBytes []byte, obj interface{}, apiName string) error + func FormatPrivateKey(privateKey string) string + func GetJson(ctx *Context, uri string, obj interface{}) ([]byte, error) + func NewConfig() + func PKCS5Padding(ciphertext []byte, blockSize int) []byte + func PKCS5UnPadding(origData []byte) []byte + func ParsePrivateKey(privateKey string) (priKey *rsa.PrivateKey, err error) + func PostForm(ctx *Context, uri, apiName string, obj interface{}, files map[string]io.Reader) ([]byte, error) + func PostJSON(ctx *Context, uri string, obj interface{}) ([]byte, error) + func RsaSign(plaintext string, privateKey string) (ciphertext string, err error) + func TripleDesDecrypt(crypted, des3key []byte) ([]byte, error) + func TripleDesEncrypt(origData, des3key []byte) ([]byte, error) + type CommonResponse struct + Code StatusCode + Message string + RequestId string + type Config struct + Appkey string + Broker string + Dealer string + DesKey string + PrivateKey string + type Context struct + ApiAddr string + Signer Signer + func NewContext(ctx context.Context, cnf *Config, apiAddr string, sign Signer) *Context + func (ctx *Context) Deadline() (deadline time.Time, ok bool) + func (ctx *Context) Done() <-chan struct{} + func (ctx *Context) Err() error + func (ctx *Context) Value(key interface{}) interface{} + type Error struct + ApiName string + Code StatusCode + Message string + RequestId string + func (e *Error) Error() string + type Signer interface + Sign func(params string) (string, error) + Type func() string + func NewRsaSing(privateKey string) Signer + func NewSHA256Sign(key string) Signer + type StatusCode string + func (s StatusCode) Message() string + type Time struct + func (t *Time) UnmarshalJson(data []byte) (err error) + func (t Time) MarshalJSON() ([]byte, error)