download

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInsecure

func GetInsecure(uri, dir string, fetcher Fetcher) error

GetInsecure downloads a zip and extracts it to the dir.

func GetWithSha256

func GetWithSha256(uri, dir, sha string, fetcher Fetcher) error

GetWithSha256 downloads a zip, verifies it and extracts it to the dir.

Types

type Fetcher

type Fetcher interface {
	// Get gets the file and returns an stream to read the file.
	Get(uri string) (io.ReadCloser, error)
}

Fetcher is used to get files from a URI.

func NewFileFetcher added in v0.2.0

func NewFileFetcher(path string) Fetcher

NewFileFetcher returns a local file reader.

type HTTPFetcher

type HTTPFetcher struct{}

HTTPFetcher is used to get a file from a http:// or https:// schema path.

func (HTTPFetcher) Get

func (HTTPFetcher) Get(uri string) (io.ReadCloser, error)

Get gets the file and returns an stream to read the file.

Jump to

Keyboard shortcuts

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