Make downloader type configurable

This commit is contained in:
Lorenzo Bolla
2022-01-28 11:13:22 +01:00
parent cc30ef3ee2
commit 1afcd68e01
11 changed files with 22 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ type ConfigStructure struct { // nolint: maligned
DownloadConcurrency int `json:"downloadConcurrency"`
DownloadLimit int64 `json:"downloadSpeedLimit"`
DownloadRetries int `json:"downloadRetries"`
Downloader string `json:"downloader"`
DatabaseOpenAttempts int `json:"databaseOpenAttempts"`
Architectures []string `json:"architectures"`
DepFollowSuggests bool `json:"dependencyFollowSuggests"`
@@ -87,6 +88,7 @@ var Config = ConfigStructure{
RootDir: filepath.Join(os.Getenv("HOME"), ".aptly"),
DownloadConcurrency: 4,
DownloadLimit: 0,
Downloader: "default",
DatabaseOpenAttempts: -1,
Architectures: []string{},
DepFollowSuggests: false,

View File

@@ -63,6 +63,7 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
" \"downloadConcurrency\": 5,\n"+
" \"downloadSpeedLimit\": 0,\n"+
" \"downloadRetries\": 0,\n"+
" \"downloader\": \"\",\n"+
" \"databaseOpenAttempts\": 5,\n"+
" \"architectures\": null,\n"+
" \"dependencyFollowSuggests\": false,\n"+