client

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(cfg *clitypes.Config) (*Client, error)

func NewFromConfig

func NewFromConfig(ctx context.Context) (*Client, error)

func NewFromConfigUnauthenticated

func NewFromConfigUnauthenticated(ctx context.Context) (*Client, error)

func NewUnauthenticated

func NewUnauthenticated(cfg *clitypes.Config) (*Client, error)

func (*Client) DeleteJSON

func (c *Client) DeleteJSON[T any](ctx context.Context, path string) (*types.ApiResponse[T], error)

func (*Client) DoEnvelope

func (c *Client) DoEnvelope[T any](ctx context.Context, method, path string, body any) (*types.ApiResponse[T], error)

func (*Client) DoJSON

func (c *Client) DoJSON[T any](ctx context.Context, method, path string, body any, headers ...http.Header) (T, error)

func (*Client) DoRaw

func (c *Client) DoRaw(ctx context.Context, method, path string, body any) ([]byte, error)

func (*Client) EnvID

func (c *Client) EnvID() string

func (*Client) GetJSON

func (c *Client) GetJSON[T any](ctx context.Context, path string) (*types.ApiResponse[T], error)

func (*Client) PostJSON

func (c *Client) PostJSON[T any](ctx context.Context, path string, body any) (*types.ApiResponse[T], error)

func (*Client) PutJSON

func (c *Client) PutJSON[T any](ctx context.Context, path string, body any) (*types.ApiResponse[T], error)

func (*Client) Request

func (c *Client) Request(ctx context.Context, method, path string, body any, headers ...http.Header) (*http.Response, error)

func (*Client) RequestRaw

func (c *Client) RequestRaw(ctx context.Context, method, path string, body io.Reader, headers map[string]string) (*http.Response, error)

func (*Client) SetEnvironment

func (c *Client) SetEnvironment(envID string)

func (*Client) SetRetryPolicy

func (c *Client) SetRetryPolicy(maxAttempts int, baseBackoff, maxBackoff time.Duration)

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration)

func (*Client) TestConnection

func (c *Client) TestConnection(ctx context.Context) error

type StatusError

type StatusError struct {
	Body       string
	StatusCode int
}

func (*StatusError) Error

func (e *StatusError) Error() string

Jump to

Keyboard shortcuts

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