core

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package core 为SDK 核心包,包含SDKClient

Index

Constants

View Source
const (
	// PRODUCT_GATEWAY 生产环境HTTPS地址
	PRODUCT_GATEWAY = "https://eco.taobao.com/router/rest"

	// SANDBOX_GATEWAY 箱环境HTTPS地址
	SANDBOX_GATEWAY = "https://gw.api.tbsandbox.com/router/rest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Otel added in v1.4.0

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

func NewOtel added in v1.4.0

func NewOtel(namespace string, appKey string) *Otel

func (*Otel) WithSpan added in v1.4.0

func (o *Otel) WithSpan(ctx context.Context, methodName string, req *http.Request, resp model.IResponse, payload []byte, fn func(*http.Request, model.IResponse) (*http.Response, error)) error

type SDKClient

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

SDKClient 结构体

func NewSDKClient

func NewSDKClient(appKey string, secret string) *SDKClient

NewSDKClient 新建SDKClient

func (*SDKClient) DisableSandbox

func (c *SDKClient) DisableSandbox()

DisableSandbox 禁用沙箱环境

func (SDKClient) IsDebug added in v1.2.0

func (c SDKClient) IsDebug() bool

IsDebug 判断是否debug

func (SDKClient) IsSandbox added in v1.2.0

func (c SDKClient) IsSandbox() bool

IsSandbox 判断是否沙箱环境

func (*SDKClient) Post

func (c *SDKClient) Post(ctx context.Context, req model.IRequest, resp model.IResponse, session string) error

Post 发起请求

func (*SDKClient) SetAPIFormat

func (c *SDKClient) SetAPIFormat(format model.APIFormat)

SetAPIFormat 设置API响应格式

func (*SDKClient) SetDebug

func (c *SDKClient) SetDebug(debug bool)

SetDebug 设置debug

func (*SDKClient) SetGateway added in v1.3.5

func (c *SDKClient) SetGateway(gateway string)

SetGateway 设置gateway

func (*SDKClient) SetSignMethod

func (c *SDKClient) SetSignMethod(method model.SignMethod)

SetSignMethod 设置API签名方法

func (*SDKClient) UseSandbox

func (c *SDKClient) UseSandbox()

UseSandbox 使用沙箱环境

func (*SDKClient) WithSpan added in v1.4.0

func (c *SDKClient) WithSpan(ctx context.Context, methodName string, req *http.Request, resp model.IResponse, payload []byte, fn func(*http.Request, model.IResponse) (*http.Response, error)) error

func (*SDKClient) WithTracer added in v1.4.0

func (c *SDKClient) WithTracer(namespace string)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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