Documentation ¶
Index ¶
- Constants
- Variables
- 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
- type Config
- type Context
- type Error
- type Signer
- type StatusCode
- type Time
Constants ¶
View Source
const ( PEM_BEGIN = "-----BEGIN RSA PRIVATE KEY-----\n" PEM_END = "\n-----END RSA PRIVATE KEY-----" )
Variables ¶
View Source
var (
ShangHaiTimeLocation, _ = time.LoadLocation("Asia/Shanghai")
)
Functions ¶
func DecodeWithError ¶
func FormatPrivateKey ¶
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func ParsePrivateKey ¶
func ParsePrivateKey(privateKey string) (priKey *rsa.PrivateKey, err error)
Types ¶
type CommonResponse ¶
type CommonResponse struct { Code StatusCode `json:"code"` Message string `json:"message"` RequestId string `json:"request_id"` }
type Config ¶
type Config struct { DesKey string `json:"des_key" yaml:"des_key" mapstructure:"des_key"` Appkey string `json:"app_key" yaml:"app_key" mapstructure:"app_key"` Dealer string `json:"dealer" yaml:"dealer" mapstructure:"dealer"` Broker string `json:"broker" yaml:"broker" mapstructure:"broker"` PrivateKey string `json:"private_key" yaml:"private_key" mapstructure:"private"` }
Config for 云账户
type Context ¶
type Context struct { *Config ApiAddr string Signer Signer // contains filtered or unexported fields }
func NewContext ¶
type StatusCode ¶
type StatusCode string
func (StatusCode) Message ¶
func (s StatusCode) Message() string
Click to show internal directories.
Click to hide internal directories.