fetch

package
v5.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 5 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	Fetch() ([]byte, error)
}

Fetcher is the interface that wraps the Fetch method. A Fetcher should return the same resource with every fetch, and `Fetch` should only return different data when the resource changes.

Fetch returns bytes fetched from some source, and any error.

func NewFile

func NewFile(path string) Fetcher

func NewFileRoundRobin

func NewFileRoundRobin(paths []string, timeout time.Duration, userAgent string) Fetcher

func NewHTTP

func NewHTTP(url string, timeout time.Duration, userAgent string) Fetcher

func NewHTTPRoundRobin

func NewHTTPRoundRobin(hosts []string, path string, timeout time.Duration, userAgent string) Fetcher

func NewRoundRobin

func NewRoundRobin(fetchers []Fetcher) Fetcher

Jump to

Keyboard shortcuts

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