snopensdk

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	ApiGatewayUrl = "https://open.suning.com/api/http/sopRequest"
	ApiFormat     = "json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRequest

type DefaultRequest interface {
	AddParameter(string, interface{})
	GetParameters() map[string]interface{}
	GetApiName() string
	GetVersion() string
	CheckParameters()
}

type DefaultResponse

type DefaultResponse interface {
	//解析返回结果
	WrapResult(result string)
	IsError() bool
}

type TopClient

type TopClient struct {
	Appkey         string
	AppSecret      string
	RequestTimeOut time.Duration
	HttpClient     *http.Client
	ProxyUrl       string
	SysParameters  *url.Values //系统变量
}

func (*TopClient) CreateSign

func (u *TopClient) CreateSign(params map[string]interface{})

func (*TopClient) CreateStrParam

func (u *TopClient) CreateStrParam() string

func (*TopClient) Exec

func (u *TopClient) Exec(request DefaultRequest, response DefaultResponse) error

func (*TopClient) Execute

func (u *TopClient) Execute(params map[string]interface{}) (string, error)

func (*TopClient) Init

func (u *TopClient) Init(appKey, appSecret, sessionkey string)

func (*TopClient) PostRequest

func (u *TopClient) PostRequest(uri, body string) (string, error)

发送POST请求

Jump to

Keyboard shortcuts

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