httputil

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout  = 30 * time.Second
	DefaultAttempts = 3
)

Variables

View Source
var (
	ErrorNoResults        = errors.New("no results")
	ErrorManuallyCanceled = errors.New("request was manually canceled")
	ErrorTimeout          = errors.New("request timed out")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	FetchWithMethod(ctx context.Context, method, path, authorization string, body io.Reader) (io.ReadCloser, error)
}

func NewHTTPClient

func NewHTTPClient(options ...ClientOption) (Client, error)

type ClientOption

type ClientOption func(*httpClient) error

func WithAttempts

func WithAttempts(attempts uint) ClientOption

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

Jump to

Keyboard shortcuts

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