httpclient

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithHttpClient

func WithHttpClient(httpClient *http.Client, host string) clientOptionFunc

func WithHttpClientTimeout

func WithHttpClientTimeout(timeout time.Duration, host string) clientOptionFunc

func WithUnixSock

func WithUnixSock(unixSockPath string, host string) clientOptionFunc

Types

type Getter

type Getter interface {
	Get(ctx context.Context, url string) (io.ReadCloser, int, error)
}

func NewClient

func NewClient(opts ...clientOption) (Getter, error)

type GetterFunc

type GetterFunc func(ctx context.Context, url string) (io.ReadCloser, int, error)

func (GetterFunc) Get

func (fn GetterFunc) Get(ctx context.Context, url string) (io.ReadCloser, int, error)

Jump to

Keyboard shortcuts

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