fetcher

package
v0.0.0-...-5af8586 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupportedContentType = errors.New("got not supported content type")
	ErrNotSupportedScheme      = errors.New("got not supported scheme")
	SupportedContentTypes      = []string{"image/jpeg"}
)

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	Fetch(ctx context.Context, url string, header http.Header) ([]byte, error)
}

type HTTPFetcher

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

func NewFetcher

func NewFetcher(l logging.Logger, connectTimeout time.Duration, requestTimeout time.Duration) *HTTPFetcher

func (HTTPFetcher) Fetch

func (f HTTPFetcher) Fetch(ctx context.Context, url string, header http.Header) ([]byte, error)

Jump to

Keyboard shortcuts

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