client

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 10 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 NewClient

func NewClient(baseUrl string, client *http.Client) *Client

func (*Client) Do

func (c *Client) Do(
	ctx context.Context,
	method string,
	path string,
	body any,
	out any,
	protected bool,
) error

func (*Client) Refresh

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

func (*Client) SetBaseURL added in v1.6.2

func (c *Client) SetBaseURL(url string)

type ErrorDetail added in v1.4.0

type ErrorDetail struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Hint    string `json:"hint"`
}

ErrorDetail represents the structured error body from the server.

type ErrorResponse

type ErrorResponse struct {
	Error ErrorDetail `json:"error"`
}

ErrorResponse wraps the server error envelope: {"error": {...}}.

type HTTPError

type HTTPError struct {
	Status  int
	Code    string
	Message string
	Hint    string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

Jump to

Keyboard shortcuts

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