request

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do[T any](r *Request) (resp *T, err error)

func Subscribe

func Subscribe[T any](ctx context.Context, client WebSocketClient, endpoint string, callback func(message *T, err error)) (done chan<- struct{}, stop <-chan struct{}, err error)

Types

type Client

type Client interface {
	GetHttpClient() *resty.Client
	GetRecvWindow() int64
	GetApiKey() string
	GetSecretKey() string
	GetLogger() log.Logger
	GetSignFn() func(apiKey, secretKey string, payload string) (string, error)
	GetTimeOffsetMs() int64
	SetUsedWeight(used, used1m *int64)
	SetOrderCount(count10s, count1d *int64)
}

type Request

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

func Delete

func Delete(ctx context.Context, client Client, url string, params ...map[string]string) *Request

func Get

func Get(ctx context.Context, client Client, url string, params ...map[string]string) *Request

func Post

func Post(client Client, ctx context.Context, url string, body ...map[string]string) *Request

func Put

func Put(ctx context.Context, client Client, url string, params ...map[string]string) *Request

func (*Request) WithApiKey

func (r *Request) WithApiKey() *Request

func (*Request) WithSignature

func (r *Request) WithSignature() *Request

type WebSocketClient

type WebSocketClient interface {
	GetHttpClient() *resty.Client
	GetLogger() log.Logger
}

Jump to

Keyboard shortcuts

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