fetcher

package
v0.0.0-...-6c35e8a Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchOptions

type FetchOptions struct {
	// contains filtered or unexported fields
}

type FetchOptionsFn

type FetchOptionsFn func(opt *FetchOptions)

func WithPassword

func WithPassword(password string) FetchOptionsFn

WithPassword provides optional password to the URL fetch.

func WithToken

func WithToken(token string) FetchOptionsFn

WithToken provides optional token to the URL fetch.

func WithUsername

func WithUsername(username string) FetchOptionsFn

WithUsername provides optional username to the URL fetch.

type Fetcher

type Fetcher struct {
	// contains filtered or unexported fields
}

Fetcher wraps an HTTP client.

func NewFetcher

func NewFetcher(client *http.Client) *Fetcher

NewFetcher constructs a new client wrapper with a given client.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context, url, dir string, opts ...FetchOptionsFn) (string, error)

Fetch constructs a request and does a client.Do with it.

Jump to

Keyboard shortcuts

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