1
0
Fork 0

Use NoCompress instead

master
Philip O'Toole 1 year ago
parent b31148c718
commit 30a029b1c9

@ -74,7 +74,7 @@ func (s *StorageType) UnmarshalJSON(b []byte) error {
type Config struct { type Config struct {
Version int `json:"version"` Version int `json:"version"`
Type StorageType `json:"type"` Type StorageType `json:"type"`
Compress bool `json:"compress,omitempty"` NoCompress bool `json:"no_compress,omitempty"`
Interval Duration `json:"interval"` Interval Duration `json:"interval"`
Sub json.RawMessage `json:"sub"` Sub json.RawMessage `json:"sub"`
} }

@ -21,7 +21,7 @@ func TestUnmarshal(t *testing.T) {
{ {
"version": 1, "version": 1,
"type": "s3", "type": "s3",
"compress": true, "no_compress": true,
"interval": "24h", "interval": "24h",
"sub": { "sub": {
"access_key_id": "test_id", "access_key_id": "test_id",
@ -35,7 +35,7 @@ func TestUnmarshal(t *testing.T) {
expectedCfg: &Config{ expectedCfg: &Config{
Version: 1, Version: 1,
Type: "s3", Type: "s3",
Compress: true, NoCompress: true,
Interval: 24 * Duration(time.Hour), Interval: 24 * Duration(time.Hour),
}, },
expectedS3: &S3Config{ expectedS3: &S3Config{
@ -53,7 +53,7 @@ func TestUnmarshal(t *testing.T) {
{ {
"version": 2, "version": 2,
"type": "s3", "type": "s3",
"compress": true, "no_compress": false,
"interval": "24h", "interval": "24h",
"sub": { "sub": {
"access_key_id": "test_id", "access_key_id": "test_id",
@ -73,7 +73,7 @@ func TestUnmarshal(t *testing.T) {
{ {
"version": 1, "version": 1,
"type": "unsupported", "type": "unsupported",
"compress": true, "no_compress": true,
"interval": "24h", "interval": "24h",
"sub": { "sub": {
"access_key_id": "test_id", "access_key_id": "test_id",
@ -117,6 +117,6 @@ func compareConfig(a, b *Config) bool {
} }
return a.Version == b.Version && return a.Version == b.Version &&
a.Type == b.Type && a.Type == b.Type &&
a.Compress == b.Compress && a.NoCompress == b.NoCompress &&
a.Interval == b.Interval a.Interval == b.Interval
} }

Loading…
Cancel
Save