client

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRequestFailed = errors.New("request failed")
View Source
var ErrResponseIncomplete = errors.New("response incomplete")

Functions

func New

func New(opts Options) (api.Interface, error)

New returns a new API client.

Types

type Logger

type Logger interface {
	Print(...any)
	Printf(string, ...any)
}

type Options

type Options struct {
	// URL of the server to connect to.
	Address string

	Logger Logger

	// Customize the User-Agent header sent to the server.
	UserAgent string

	// Client is used to make HTTP requests. If not provided http.DefaultClient
	// is used.
	Client *http.Client
}

Options defines the options for a new client.

Jump to

Keyboard shortcuts

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