core

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package core 包含SDKClient

Index

Constants

View Source
const (
	// GATEWAY 默认APIgateway
	GATEWAY = "https://gw-api.pinduoduo.com/api/router"
	// UPLOAD GATEWAY
	UPLOAD_GATEWAY = "https://gw-upload.pinduoduo.com/api/upload"
	// WSSEndPoint wws endpoint
	WSSEndPoint = "wss://message-api.pinduoduo.com/message"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Otel added in v1.2.5

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

func NewOtel added in v1.2.5

func NewOtel(namespace string, appKey string) *Otel

func (*Otel) WithSpan added in v1.2.5

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

type SDKClient

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

SDKClient sdk client

func NewSDKClient

func NewSDKClient(clientID string, secret string) *SDKClient

NewSDKClient 创建SDKClient

func (*SDKClient) ClientID

func (c *SDKClient) ClientID() string

ClientID returns client client_id

func (*SDKClient) Do

func (c *SDKClient) Do(ctx context.Context, req model.Request, resp model.Response, accessToken string) error

func (*SDKClient) SetDataType

func (c *SDKClient) SetDataType(t model.RequestDataType)

SetDataType 设置返回数据格式

func (*SDKClient) SetDebug

func (c *SDKClient) SetDebug(debug bool)

SetDebug 设置debug模式

func (*SDKClient) SetGateway

func (c *SDKClient) SetGateway(gw string)

SetGateway 设置gateway

func (*SDKClient) SetHttpClient added in v1.2.5

func (c *SDKClient) SetHttpClient(client *http.Client)

SetHttpClient 设置http.Client

func (*SDKClient) SetUploadGateway added in v1.1.6

func (c *SDKClient) SetUploadGateway(gw string)

func (*SDKClient) Upload added in v1.1.6

func (c *SDKClient) Upload(ctx context.Context, req model.UploadRequest, resp model.Response, accessToken string) error

func (*SDKClient) WSSUrl added in v1.0.9

func (c *SDKClient) WSSUrl() string

func (*SDKClient) WithSpan added in v1.2.5

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

func (*SDKClient) WithTracer added in v1.2.5

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