core

package
v1.28.6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 23 Imported by: 60

Documentation

Overview

Package core 包含SDKClient

Index

Constants

View Source
const (
	// BASE_URL 默认APIgateway
	BASE_URL = "https://ad.oceanengine.com/open_api/"
	// API_BASE_URL 默认APIgateway
	API_BASE_URL = "https://api.oceanengine.com/open_api/"
	// ANALYTICS_URL 转化回传API gateway
	ANALYTICS_URL = "https://analytics.oceanengine.com/api/v2/"
	// ANALYTICSV1_URL 电话转化回传API gateway
	ANALYTICSV1_URL = "https://analytics.oceanengine.com/api/v1/"
	// TRACK_URL  转化事件回调服务 gateway
	TRACK_URL = "https://ad.oceanengine.com/track/activate/"
	// OPEN_URL OpenAPI gateway
	OPEN_URL = "https://open.oceanengine.com/open_api/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Otel added in v1.27.0

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

func NewOtel added in v1.27.0

func NewOtel(namespace string, appID uint64) *Otel

func (*Otel) WithSpan added in v1.27.0

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

type RateLimiter added in v1.8.8

type RateLimiter interface {
	Take() time.Duration
}

type SDKClient

type SDKClient struct {
	Secret string

	AppID uint64
	// contains filtered or unexported fields
}

SDKClient sdk client

func NewSDKClient

func NewSDKClient(appID uint64, secret string) *SDKClient

NewSDKClient 创建SDKClient

func (*SDKClient) AnalyticsPost added in v1.1.0

func (c *SDKClient) AnalyticsPost(ctx context.Context, gw string, req model.ConversionRequest, resp model.Response) error

AnalyticsPost 转化回传API专用

func (*SDKClient) AnalyticsV1Post added in v1.7.12

func (c *SDKClient) AnalyticsV1Post(ctx context.Context, gw string, req model.PostRequest, resp model.Response) error

AnalyticsV1Post 电话转化回传API专用

func (*SDKClient) Copy added in v1.8.0

func (c *SDKClient) Copy() *SDKClient

Copy 复制SDKClient

func (*SDKClient) DisableSandbox

func (c *SDKClient) DisableSandbox()

DisableSandbox 禁用sandbox

func (*SDKClient) Get

func (c *SDKClient) Get(ctx context.Context, gw string, req model.GetRequest, resp model.Response, accessToken string) error

Get get api

func (*SDKClient) GetAPI added in v1.26.5

func (c *SDKClient) GetAPI(ctx context.Context, gw string, req model.GetRequest, resp model.Response, accessToken string) error

func (*SDKClient) GetBytes added in v1.6.39

func (c *SDKClient) GetBytes(ctx context.Context, gw string, req model.GetRequest, accessToken string) ([]byte, error)

GetBytes get bytes api

func (*SDKClient) OpenGet added in v1.8.1

func (c *SDKClient) OpenGet(ctx context.Context, gw string, req model.GetRequest, resp model.Response, accessToken string) error

OpenGet get api

func (*SDKClient) Post

func (c *SDKClient) Post(ctx context.Context, gw string, req model.PostRequest, resp model.Response, accessToken string) error

Post post api

func (*SDKClient) PostAPI added in v1.26.5

func (c *SDKClient) PostAPI(ctx context.Context, gw string, req model.PostRequest, resp model.Response, accessToken string) error

func (*SDKClient) SetDebug

func (c *SDKClient) SetDebug(debug bool)

SetDebug 设置debug模式

func (*SDKClient) SetHttpClient added in v1.8.0

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

SetHttpClient 设置http.Client

func (*SDKClient) SetOperatorIP added in v1.8.0

func (c *SDKClient) SetOperatorIP(ip string)

SetOperatorIP 设置操作者IP, 支持ipv4/ipv6

func (*SDKClient) SetRateLimiter added in v1.8.8

func (c *SDKClient) SetRateLimiter(limiter RateLimiter)

SetRateLimiter 设置限流

func (*SDKClient) TrackActive added in v1.16.7

func (c *SDKClient) TrackActive(ctx context.Context, req model.TrackRequest, resp model.Response) error

TrackActive 转化回传API专用

func (*SDKClient) Upload added in v1.1.3

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

Upload multipart/form-data post

func (*SDKClient) UploadAPI added in v1.28.3

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

func (*SDKClient) UseSandbox

func (c *SDKClient) UseSandbox()

UseSandbox 启用sandbox

func (*SDKClient) WithSpan added in v1.27.0

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

func (*SDKClient) WithTracer added in v1.27.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