api

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadStatusCode = fmt.Errorf("bad status code")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(baseURL string, opts ...ClientOption) Client

NewClient returns a new Client with the given baseURL and options.

func (Client) Request

func (cl Client) Request(ctx context.Context, method, url string, out interface{}) error

type ClientOption added in v0.8.0

type ClientOption func(*Client)

func WithAuthentication added in v0.8.0

func WithAuthentication(token string) ClientOption

WithAuthentication returns a ClientOption that sets the token to be used for authentication. The token can be an API key, or it can be in the form of "username:password" for basic authentication.

func WithHTTPClient added in v0.8.0

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient returns a ClientOption that sets the HTTP client to be used.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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