client

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultipartBody

func MultipartBody(fields, files map[string]string) (body []byte, contentType string, err error)

Types

type Client

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

func New

func New(apiKey string, opts ...Option) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, body []byte, extraHeaders map[string]string) (*Response, error)

func (*Client) Paginate

func (c *Client) Paginate(ctx context.Context, path string, query url.Values, each func(item json.RawMessage) error) error

type Option

type Option func(*Client)

func WithAPIVersion

func WithAPIVersion(v string) Option

func WithBaseURL

func WithBaseURL(u string) Option

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

func WithMaxRetries

func WithMaxRetries(n int) Option

func WithSleep

func WithSleep(fn func(time.Duration)) Option

type Response

type Response struct {
	StatusCode  int
	Header      http.Header
	Body        []byte
	ContentType string
	RequestID   string
}

Jump to

Keyboard shortcuts

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