fetcher

package
v2.0.3-yckms.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFetcher

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

DefaultFetcher implements Fetcher

func (*DefaultFetcher) DownloadFile

func (d *DefaultFetcher) DownloadFile(urlPath string, maxLength int64, timeout time.Duration) ([]byte, error)

DownloadFile downloads a file from urlPath, errors out if it failed, its length is larger than maxLength or the timeout is reached.

func (*DefaultFetcher) SetHTTPUserAgent

func (d *DefaultFetcher) SetHTTPUserAgent(httpUserAgent string)

type Fetcher

type Fetcher interface {
	DownloadFile(urlPath string, maxLength int64, timeout time.Duration) ([]byte, error)
}

Fetcher interface

Jump to

Keyboard shortcuts

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