core

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v1.4.1

type Option = func(c *SDKClient)

func WithDebug added in v1.4.1

func WithDebug(debug bool) Option

SetDebug set debug mode

func WithHttpClient added in v1.4.1

func WithHttpClient(httpClient *http.Client) Option

func WithTracer added in v1.4.1

func WithTracer(namespace string) Option

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, appID string) *Otel

func (*Otel) WithSpan added in v1.4.0

func (o *Otel) WithSpan(ctx context.Context, req *http.Request, resp interface{}, payload []byte, fn func(*http.Request, interface{}) (*http.Response, error)) error

type SDKClient

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

SDKClient object

func NewSDKClient

func NewSDKClient(appID string, secret string, opts ...Option) *SDKClient

NewSDKClient init sdk client

func (*SDKClient) ActionCb added in v1.2.8

func (c *SDKClient) ActionCb(ctx context.Context, req model.ActionCbRequest) error

func (*SDKClient) AppID added in v1.2.9

func (c *SDKClient) AppID() string

func (*SDKClient) Conversion added in v1.2.8

func (c *SDKClient) Conversion(ctx context.Context, req model.ConversionRequest, resp interface{}) (*model.ResponseHeader, error)

func (*SDKClient) Do

func (c *SDKClient) Do(ctx context.Context, req *model.Request, resp interface{}) (*model.ResponseHeader, error)

Do execute api request

func (*SDKClient) Get added in v1.2.8

func (c *SDKClient) Get(ctx context.Context, reqUrl string, resp interface{}) error

Get data through api

func (*SDKClient) OAuth added in v1.2.9

func (c *SDKClient) OAuth(ctx context.Context, req model.RequestBody, resp interface{}) error

OAuth execute oauth api request

func (*SDKClient) Post

func (c *SDKClient) Post(ctx context.Context, reqUrl string, bs []byte, resp interface{}) error

Post data through api

func (*SDKClient) Secret added in v1.2.9

func (c *SDKClient) Secret() string

func (*SDKClient) WithSpan added in v1.4.0

func (c *SDKClient) WithSpan(ctx context.Context, req *http.Request, resp interface{}, payload []byte, fn func(*http.Request, interface{}) (*http.Response, error)) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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