Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidStatusCode = errors.New("status code was not 200")
ErrInvalidStatusCode is returned if the status code was not 200
Functions ¶
This section is empty.
Types ¶
type DownloadManager ¶
type DownloadManager struct { OnProgress func(p int) // contains filtered or unexported fields }
DownloadManager includes a queue to download
func (*DownloadManager) Add ¶
func (d *DownloadManager) Add(i Downloader)
Add adds a new item to the queue
type Downloader ¶
Downloader allows downloadmgr to download the file
type ErrFailedAttempt ¶
type ErrFailedAttempt struct {
// contains filtered or unexported fields
}
func (*ErrFailedAttempt) Error ¶
func (e *ErrFailedAttempt) Error() string
type ErrInvalidSha ¶
ErrInvalidSha is returned when the downloaded file's sha256 sum does not match the given sha1
func (*ErrInvalidSha) Error ¶
func (e *ErrInvalidSha) Error() string
type HTTPItem ¶
type HTTPItem struct { Client *http.Client URL string Target string Size int Sha256 string // contains filtered or unexported fields }
HTTPItem is a URL, target pair with optional properties that will be downloaded using http(s)
func NewHTTPItem ¶
NewHTTPItem creates a Item to be queued that will download the file using HTTP(S)
type WriteCounter ¶ added in v0.0.63
type WriteCounter struct {
Total *int64 // Total # of bytes transferred
}
WriteCounter counts the number of bytes written to it.
Click to show internal directories.
Click to hide internal directories.