Documentation ¶
Index ¶
- Constants
- func NewBusinessId() string
- type Client
- func (this *Client) Decrypt(encryptedStr string, usePrivateEncrypt bool) (string, error)
- func (this *Client) DecryptOrderInfo(orderInfo *order.OrderInfo, usePrivateKey bool) (err error)
- func (this *Client) DecryptUserInfo(userInfo *user.UserInfo, usePrivateKey bool) (err error)
- func (this *Client) Encrypt(str string, usePrivateEncrypt bool) (string, error)
- func (this *Client) EncryptOrderInfo(orderInfo *order.OrderInfo, usePrivateKey bool) (err error)
- func (this *Client) EncryptUserInfo(userInfo *user.UserInfo, usePrivateKey bool) (err error)
- func (this *Client) GetCurrentKey() (key crypto.Key, err error)
- func (this *Client) GetFirstKey() (key crypto.Key, err error)
- func (this *Client) GetKey(keyId string) (key crypto.Key, err error)
- func (this *Client) GetMasterKey(tid string, voucherKey string) (keyStore *crypto.KeyStore, err error)
- func (this *Client) GetUserBaseInfo(pin string, loadType int, decrypt bool) (*user.UserInfo, error)
- func (this *Client) GetVoucher() (voucherData voucher.VoucherData, err error)
- func (this *Client) Hash(oriData string, usePrivateEncrypt bool) (string, error)
- func (this *Client) PopOrderEnGet(orderId uint64, orderState []string, optionalFields []string, decrypt bool) (*order.OrderInfo, error)
- func (this *Client) PopOrderEnSearch(searchReq *PopOrderEnSearchRequest, decrypt bool) ([]order.OrderInfo, int, error)
- func (this *Client) RefreshKeyStore() (*crypto.KeyStore, error)
- func (this *Client) Report(service string, reportText ReportText, reportType ReportType, code string, ...) error
- func (this *Client) ReportStatitics() error
- func (this *Client) Salt(usePrivateEncrypt bool) ([]byte, error)
- func (this *Client) SetEnv(env string)
- func (this *Client) SetHost(host string)
- func (this *Client) StartReport()
- type PopOrderEnSearchRequest
- type ReportAttribute
- type ReportLevel
- type ReportStatistcAttribute
- type ReportText
- type ReportType
- type Service
Constants ¶
View Source
const ( DefaultServerUrl = "https://api.jd.com/routerjson" CIPHER_LEN = 2 )
Variables ¶
This section is empty.
Functions ¶
func NewBusinessId ¶
func NewBusinessId() string
Types ¶
type Client ¶
type Client struct { AppKey string AppSecret string AccessToken string SdkVer uint Host string Env string KeyStore *crypto.KeyStore Enccnt uint Deccnt uint Encerrcnt uint Decerrcnt uint Debug bool sync.RWMutex }
func (*Client) DecryptOrderInfo ¶
func (*Client) DecryptUserInfo ¶
func (*Client) EncryptOrderInfo ¶
func (*Client) EncryptUserInfo ¶
func (*Client) GetMasterKey ¶
func (*Client) GetUserBaseInfo ¶
func (*Client) GetVoucher ¶
func (this *Client) GetVoucher() (voucherData voucher.VoucherData, err error)
func (*Client) PopOrderEnGet ¶
func (*Client) PopOrderEnSearch ¶
func (*Client) Report ¶
func (this *Client) Report(service string, reportText ReportText, reportType ReportType, code string, msg string, heap string) error
func (*Client) ReportStatitics ¶
func (*Client) StartReport ¶
func (this *Client) StartReport()
type PopOrderEnSearchRequest ¶
type PopOrderEnSearchRequest struct { StartDate string `json:"start_date,omitempty" codec:"start_date,omitempty"` EndDate string `json:"end_date,omitempty" codec:"end_date,omitempty"` OrderState []string `json:"order_state,omitempty" codec:"order_state,omitempty"` OptionalFields []string `json:"optional_fields,omitempty" codec:"optional_fields,omitempty"` Page int `json:"page,omitempty" codec:"page,omitempty"` PageSize int `json:"page_size,omitempty" codec:"page_size,omitempty"` SortType uint8 `json:"sort_type,omitempty" codec:"sort_type,omitempty"` DateType uint8 `json:"date_type,omitempty" codec:"date_type,omitempty"` }
type ReportAttribute ¶
type ReportAttribute struct { Type ReportType `json:"type"` Host string `json:"host,omitempty"` Level ReportLevel `json:"level,omitempty"` Service string `json:"service,omitempty"` SdkVer uint `json:"sdk_ver"` Env string `json:"env,omitempty"` Ts int64 `json:"ts"` Code string `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Heap string `json:"heap,omitempty"` Enccnt uint `json:"enccnt,omitempty"` Deccnt uint `json:"deccnt,omitempty"` }
type ReportLevel ¶
type ReportLevel = uint
const ( INFO_LEVEL ReportLevel = 1 WARN_LEVEL ReportLevel = 2 ERROR_LEVEL ReportLevel = 3 SEVERE_LEVEL ReportLevel = 4 )
type ReportStatistcAttribute ¶
type ReportStatistcAttribute struct { Type ReportType `json:"type"` Host string `json:"host,omitempty"` Level ReportLevel `json:"level,omitempty"` Service string `json:"service,omitempty"` SdkVer uint `json:"sdk_ver"` Env string `json:"env,omitempty"` Ts int64 `json:"ts"` Enccnt uint `json:"enccnt"` Deccnt uint `json:"deccnt"` Encerrcnt uint `json:"encerrcnt"` Decerrcnt uint `json:"decerrcnt"` }
type ReportText ¶
type ReportText = string
const ( INIT ReportText = "INIT" EXCEPTION ReportText = "EXCEPTION" STATISTIC ReportText = "STATISTIC" EVENT ReportText = "EVENT" )
type ReportType ¶
type ReportType = uint
const ( INIT_TYPE ReportType = 1 EXCEPTION_TYPE ReportType = 2 STATISTIC_TYPE ReportType = 3 EVENT_TYPE ReportType = 4 )
Click to show internal directories.
Click to hide internal directories.