New config setting: downloadSpeedLimit to limit download speed. #62

This commit is contained in:
Andrey Smirnov
2014-07-13 15:47:23 +04:00
parent fb1e28b91b
commit a54a366c95
4 changed files with 22 additions and 3 deletions
+2
View File
@@ -10,6 +10,7 @@ import (
type ConfigStructure struct {
RootDir string `json:"rootDir"`
DownloadConcurrency int `json:"downloadConcurrency"`
DownloadLimit int64 `json:"downloadSpeedLimit"`
Architectures []string `json:"architectures"`
DepFollowSuggests bool `json:"dependencyFollowSuggests"`
DepFollowRecommends bool `json:"dependencyFollowRecommends"`
@@ -26,6 +27,7 @@ type ConfigStructure struct {
var Config = ConfigStructure{
RootDir: filepath.Join(os.Getenv("HOME"), ".aptly"),
DownloadConcurrency: 4,
DownloadLimit: 0,
Architectures: []string{},
DepFollowSuggests: false,
DepFollowRecommends: false,
+1
View File
@@ -44,6 +44,7 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
"{\n"+
" \"rootDir\": \"/tmp/aptly\",\n"+
" \"downloadConcurrency\": 5,\n"+
" \"downloadSpeedLimit\": 0,\n"+
" \"architectures\": null,\n"+
" \"dependencyFollowSuggests\": false,\n"+
" \"dependencyFollowRecommends\": false,\n"+