1
0
Fork 0

Add support for "exit on failure"

master
Philip O'Toole 1 year ago
parent 63ace34a95
commit ae9bc98741

@ -79,6 +79,7 @@ type Config struct {
Version int `json:"version"` Version int `json:"version"`
Type StorageType `json:"type"` Type StorageType `json:"type"`
Timeout Duration `json:"timeout,omitempty"` Timeout Duration `json:"timeout,omitempty"`
ExitOnFailure bool `json:"exit_on_failure,omitempty"`
Sub json.RawMessage `json:"sub"` Sub json.RawMessage `json:"sub"`
} }

@ -136,6 +136,7 @@ func TestUnmarshal(t *testing.T) {
Version: 1, Version: 1,
Type: "s3", Type: "s3",
Timeout: 30 * Duration(time.Second), Timeout: 30 * Duration(time.Second),
ExitOnFailure: false,
}, },
expectedS3: &aws.S3Config{ expectedS3: &aws.S3Config{
AccessKeyID: "test_id", AccessKeyID: "test_id",
@ -152,6 +153,7 @@ func TestUnmarshal(t *testing.T) {
{ {
"version": 1, "version": 1,
"type": "s3", "type": "s3",
"exit_on_failure": true,
"sub": { "sub": {
"access_key_id": "test_id", "access_key_id": "test_id",
"secret_access_key": "test_secret", "secret_access_key": "test_secret",
@ -165,6 +167,7 @@ func TestUnmarshal(t *testing.T) {
Version: 1, Version: 1,
Type: "s3", Type: "s3",
Timeout: Duration(30 * time.Second), Timeout: Duration(30 * time.Second),
ExitOnFailure: true,
}, },
expectedS3: &aws.S3Config{ expectedS3: &aws.S3Config{
AccessKeyID: "test_id", AccessKeyID: "test_id",

Loading…
Cancel
Save