Merge pull request #683 from smira/545-download-contxt

Use Go context to abort gracefully mirror updates
This commit is contained in:
Andrey Smirnov
2017-12-01 00:27:26 +03:00
committed by GitHub
12 changed files with 123 additions and 80 deletions
+3 -2
View File
@@ -3,6 +3,7 @@
package aptly
import (
"context"
"io"
"os"
@@ -124,9 +125,9 @@ type Progress interface {
// Downloader is parallel HTTP fetcher
type Downloader interface {
// Download starts new download task
Download(url string, destination string) error
Download(ctx context.Context, url string, destination string) error
// DownloadWithChecksum starts new download task with checksum verification
DownloadWithChecksum(url string, destination string, expected *utils.ChecksumInfo, ignoreMismatch bool, maxTries int) error
DownloadWithChecksum(ctx context.Context, url string, destination string, expected *utils.ChecksumInfo, ignoreMismatch bool, maxTries int) error
// GetProgress returns Progress object
GetProgress() Progress
}