Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAndExtract ¶
DownloadAndExtract downloads the specified archive uri (or uses the provided overrideFile, if a non-empty value) while validating its checksum with the provided sha256sum, and extracts its contents to extractDir that must be. created.
Types ¶
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader is responsible for fetching, verifying and extracting a binary.
func NewDownloader ¶
func NewDownloader(v Verifier, f Fetcher) Downloader
NewDownloader builds a new Downloader.
func (Downloader) Get ¶
func (d Downloader) Get(uri, dst string) error
Get pulls the uri and verifies it. On success, the download gets extracted into dst.
type Fetcher ¶
type Fetcher interface { // Get gets the file and returns an stream to read the file. Get(uri string) (io.ReadCloser, error) }
func NewFileFetcher ¶
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.
Click to show internal directories.
Click to hide internal directories.