Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchResult ¶
type BatchResult struct { *simplejson.Json Err error }
BatchResult defines the batch result.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines the open taobap client.
func NewClient ¶
func NewClient(appKey, appSecret string, opts ...ClientOption) (*Client, error)
NewClient creates the `Client` according to the given options.
func (*Client) DoJson ¶
func (c *Client) DoJson(ctx context.Context, method string, param Parameters) (res *simplejson.Json, err error)
DoJson executes the taobao api. https://open.taobao.com/doc.htm?docId=101617&docType=1
func (*Client) DoJsonBatch ¶
func (c *Client) DoJsonBatch(ctx context.Context, params ...Parameters) ([]*BatchResult, error)
DoJsonBatch executes the taobao api in batch. https://open.taobao.com/doc.htm?docId=104350&docType=1
type ClientOption ¶
type ClientOption func(opts *options)
ClientOption for building up `Client`.
func WithApiBatchURL ¶
func WithApiBatchURL(batchURL string) ClientOption
WithApiBatchURL returns a `Option` that sets the batch api URL.
func WithApiURL ¶
func WithApiURL(url string) ClientOption
WithApiURL returns a `Option` that sets the api URL.
func WithSession ¶
func WithSession(session string) ClientOption
WithSession returns a `Option` that set the session key. https://open.taobao.com/doc.htm?docId=102635&docType=1
type ErrorResponse ¶
type ErrorResponse struct { Code int32 `json:"code"` Msg string `json:"msg"` SubMsg string `json:"sub_msg"` SubCode string `json:"sub_code"` }
ErrorResponse defines the open taobao platform error response.
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type Parameters ¶
type Parameters map[string]interface{}
Parameters defines the key value pair of parameters.