Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Download ¶
type Download struct { Identifier string // contains filtered or unexported fields }
func ByID ¶
ByID returns a single Download matching a given identifier. If no download is found the second argument in the response will be false.
func New ¶
func New(s *server.Server, r DownloadRequest) *Download
New starts a new tracked download which allows for cancellation later on by calling the Downloader.Cancel function.
func (*Download) Cancel ¶
func (dl *Download) Cancel()
Cancel cancels a running download and frees up the associated resources. If a file is being written a partial file will remain present on the disk.
func (*Download) Execute ¶
Execute executes a given download for the server and begins writing the file to the disk. Once completed the download will be removed from the cache.
func (Download) MarshalJSON ¶
type DownloadRequest ¶
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader represents a global downloader that keeps track of all currently processing downloads for the machine.