Documentation ¶
Index ¶
- Constants
- func NewBusinessId() string
- type Client
- func (this *Client) Decrypt(ctx context.Context, encryptedStr string, usePrivateEncrypt bool) (string, error)
- func (this *Client) DecryptOrderInfo(ctx context.Context, orderInfo *order.OrderInfo, usePrivateKey bool) (err error)
- func (this *Client) DecryptUserInfo(ctx context.Context, userInfo *user.UserInfo, usePrivateKey bool) (err error)
- func (this *Client) Encrypt(ctx context.Context, str string, usePrivateEncrypt bool) (string, error)
- func (this *Client) EncryptOrderInfo(ctx context.Context, orderInfo *order.OrderInfo, usePrivateKey bool) (err error)
- func (this *Client) EncryptUserInfo(ctx context.Context, userInfo *user.UserInfo, usePrivateKey bool) (err error)
- func (this *Client) GetCurrentKey(ctx context.Context) (key crypto.Key, err error)
- func (this *Client) GetFirstKey(ctx context.Context) (key crypto.Key, err error)
- func (this *Client) GetKey(ctx context.Context, keyId string) (key crypto.Key, err error)
- func (this *Client) GetMasterKey(ctx context.Context, tid string, voucherKey string) (keyStore *crypto.KeyStore, err error)
- func (this *Client) GetUserBaseInfo(ctx context.Context, pin string, loadType int, decrypt bool) (*user.UserInfo, error)
- func (this *Client) GetVoucher(ctx context.Context) (voucherData voucher.VoucherData, err error)
- func (this *Client) Hash(ctx context.Context, oriData string, usePrivateEncrypt bool) (string, error)
- func (this *Client) PopOrderEnGet(ctx context.Context, orderId uint64, orderState []string, ...) (*order.OrderInfo, error)
- func (this *Client) PopOrderEnSearch(ctx context.Context, searchReq *PopOrderEnSearchRequest, decrypt bool) ([]order.OrderInfo, int, error)
- func (this *Client) RefreshKeyStore(ctx context.Context) (*crypto.KeyStore, error)
- func (this *Client) Report(ctx context.Context, service string, reportText ReportText, ...) error
- func (this *Client) ReportStatitics(ctx context.Context) error
- func (this *Client) Salt(ctx context.Context, usePrivateEncrypt bool) ([]byte, error)
- func (this *Client) SetEnv(env string)
- func (this *Client) SetHost(host string)
- func (this *Client) StartReport(ctx context.Context)
- 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) GetCurrentKey ¶
func (*Client) GetFirstKey ¶
func (*Client) GetMasterKey ¶
func (*Client) GetUserBaseInfo ¶
func (*Client) GetVoucher ¶
func (*Client) PopOrderEnGet ¶
func (*Client) PopOrderEnSearch ¶
func (*Client) RefreshKeyStore ¶
func (*Client) Report ¶
func (this *Client) Report(ctx context.Context, service string, reportText ReportText, reportType ReportType, code string, msg string, heap string) error
func (*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.