diff --git a/download/config.go b/download/config.go index 616bae09..646e4944 100644 --- a/download/config.go +++ b/download/config.go @@ -76,10 +76,11 @@ func (s *StorageType) UnmarshalJSON(b []byte) error { // Config is the config file format for the upload service type Config struct { - Version int `json:"version"` - Type StorageType `json:"type"` - Timeout Duration `json:"timeout,omitempty"` - Sub json.RawMessage `json:"sub"` + Version int `json:"version"` + Type StorageType `json:"type"` + Timeout Duration `json:"timeout,omitempty"` + ExitOnFailure bool `json:"exit_on_failure,omitempty"` + Sub json.RawMessage `json:"sub"` } // Unmarshal unmarshals the config file and returns the config and subconfig diff --git a/download/config_test.go b/download/config_test.go index efe00314..39d4c274 100644 --- a/download/config_test.go +++ b/download/config_test.go @@ -133,9 +133,10 @@ func TestUnmarshal(t *testing.T) { } `), expectedCfg: &Config{ - Version: 1, - Type: "s3", - Timeout: 30 * Duration(time.Second), + Version: 1, + Type: "s3", + Timeout: 30 * Duration(time.Second), + ExitOnFailure: false, }, expectedS3: &aws.S3Config{ AccessKeyID: "test_id", @@ -152,6 +153,7 @@ func TestUnmarshal(t *testing.T) { { "version": 1, "type": "s3", + "exit_on_failure": true, "sub": { "access_key_id": "test_id", "secret_access_key": "test_secret", @@ -162,9 +164,10 @@ func TestUnmarshal(t *testing.T) { } `), expectedCfg: &Config{ - Version: 1, - Type: "s3", - Timeout: Duration(30 * time.Second), + Version: 1, + Type: "s3", + Timeout: Duration(30 * time.Second), + ExitOnFailure: true, }, expectedS3: &aws.S3Config{ AccessKeyID: "test_id",