Documentation ¶
Index ¶
- Constants
- func ErrorString[T int | int64 | string](code T, msg string) string
- func GetBufferPool() *bytes.Buffer
- func GetOauthURL(appKey, rURI, state, scope string) string
- func GetStringsBuilder() *strings.Builder
- func GetUrlValues() url.Values
- func Json(obj interface{}) []byte
- func PutBufferPool(buf *bytes.Buffer)
- func PutStringsBuilder(b *strings.Builder)
- func PutUrlValues(vals url.Values)
- func StringsJoin(strs ...string) string
- type Client
- func (c *Client) Execute(ctx context.Context, req *Request, token string, rep IResponse) error
- func (c *Client) GenerateRawSign(params map[string]string) string
- func (c *Client) GenerateSign(stringToBeSigned string) string
- func (c *Client) GetAccessToken(code, state, redirectUri string) (string, error)
- func (c *Client) GetAccessTokenNew(code string) (string, error)
- func (c *Client) Logger() logger.Logger
- func (c *Client) PostExecute(ctx context.Context, req *Request, token string, rep IResponse) error
- func (c *Client) SetDev(dev bool)
- func (c *Client) SetHttpClient(client *http.Client)
- func (c *Client) WithSpan(ctx context.Context, methodName string, req *http.Request, resp IResponse, ...) error
- func (c *Client) WithTracer(namespace string)
- type Error
- type IResponse
- type Otel
- type Request
- type Response
Constants ¶
View Source
const ( API_VERSION = "2.0" GATEWAY_URL = "https://api.jd.com/routerjson" GATEWAY_DEV_URL = "https://api-dev.jd.com/routerjson" LOG_GATEWAY_URL = "https://api-log.jd.com/routerjson" UNION_GATEWAY_URL = "https://api.jd.com/routerjson" )
Variables ¶
This section is empty.
Functions ¶
func ErrorString ¶ added in v1.1.3
func GetBufferPool ¶ added in v1.1.3
func GetOauthURL ¶
func GetStringsBuilder ¶ added in v1.1.3
func GetUrlValues ¶ added in v1.1.3
func PutBufferPool ¶ added in v1.1.3
func PutStringsBuilder ¶ added in v1.1.3
func PutUrlValues ¶ added in v1.1.3
func StringsJoin ¶ added in v1.1.3
Types ¶
type Client ¶
type Client struct { AppKey string SecretKey string Dev bool Debug bool // contains filtered or unexported fields }
func (*Client) GenerateSign ¶
func (*Client) GetAccessToken ¶
func (*Client) PostExecute ¶
func (*Client) SetHttpClient ¶ added in v1.2.3
SetHttpClient 设置http.Client
func (*Client) WithTracer ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.