downloader

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheFilename added in v0.7.0

func CacheFilename(url string) string

CacheFilename returns the computed filename for the url.

func Download

func Download(host hostActions, r Request) (string, error)

Download downloads file at url and returns the location of the downloaded file.

func DownloadToGuest added in v0.7.0

func DownloadToGuest(host hostActions, guest guestActions, r Request, filename string) error

DownloadToGuest downloads file at url and saves it in the destination.

In the implementation, the file is downloaded (and cached) on the host, but copied to the desired destination for the guest. filename must be an absolute path and a directory on the guest that does not require root access.

Types

type Request added in v0.6.0

type Request struct {
	URL string // request URL
	SHA *SHA   // shasum url
}

Request is download request

type SHA added in v0.6.0

type SHA struct {
	URL    string // url to download the shasum file (if Digest is empty)
	Size   int    // one of 256 or 512
	Digest string // shasum
}

Jump to

Keyboard shortcuts

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