request

package
v0.0.0-...-e791d11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCallTOPAPIFailed = errors.New("call Taobao Open Platform API failed")
	ErrTOPAPIBizError   = errors.New("call Taobao Open Platform API biz error")
)

Functions

func WithFormat

func WithFormat(format string) option

func WithSimplify

func WithSimplify(isSimplified bool) option

func WithVersion

func WithVersion(version string) option

Types

type APIRequest

type APIRequest struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(appKey, appSecret, sessionKey string, options ...option) APIRequest

func (APIRequest) Get

func (req APIRequest) Get(apiName string, params url.Values) (Values, error)

func (APIRequest) GetAll

func (req APIRequest) GetAll(apiName string, params url.Values, pageNumberKey, pageSizeKey string, parseTotal parseTotalFunc) ([]Values, error)

func (APIRequest) GetMock

func (req APIRequest) GetMock(apiName string, params url.Values) (Values, error)

type Values

type Values map[string]interface{}

func (Values) Delete

func (vals Values) Delete(key string)

func (Values) Get

func (vals Values) Get(key string) interface{}

func (Values) GetResult

func (vals Values) GetResult(resType interface{}) (interface{}, error)

func (Values) Set

func (vals Values) Set(key string, value interface{})

func (Values) String

func (vals Values) String() string

func (Values) ToQueryParams

func (vals Values) ToQueryParams() (map[string]string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL