core

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package core 包含SDKClient

Index

Constants

View Source
const (
	// BASE_URL 默认API gateway
	BASE_URL = "https://adapi.xiaohongshu.com/api/open"
	// HAWKLING_LEADS_URL 聚光落地页线索数据回传API gateway
	HAWKLING_LEADS_URL = "http://www.xiaohongshu.com/api/hawking/leads/return"
	// OAUTH_URL oauth授权 gateway
	OAUTH_URL = "https://ad.xiaohongshu.com/aurora/openApiAuth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimiter

type RateLimiter interface {
	Take() time.Duration
}

type SDKClient

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

SDKClient sdk client

func NewSDKClient

func NewSDKClient(appID uint64, secret string) *SDKClient

NewSDKClient 创建SDKClient

func (*SDKClient) AppID

func (c *SDKClient) AppID() uint64

func (*SDKClient) Copy

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) Post

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

Post post api

func (*SDKClient) PostHawkingLeads added in v1.0.2

func (c *SDKClient) PostHawkingLeads(ctx context.Context, req model.PostRequest) error

PostHawkingLeads

func (*SDKClient) Secret added in v1.0.2

func (c *SDKClient) Secret() string

func (*SDKClient) SetDebug

func (c *SDKClient) SetDebug(debug bool)

SetDebug 设置debug模式

func (*SDKClient) SetHttpClient

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

SetHttpClient 设置http.Client

func (*SDKClient) SetRateLimiter

func (c *SDKClient) SetRateLimiter(limiter RateLimiter)

SetRateLimiter 设置限流

func (*SDKClient) Upload

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) UseSandbox

func (c *SDKClient) UseSandbox()

UseSandbox 启用sandbox

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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