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 {
Version int `json:"version"`
Type StorageType `json:"type"`
Compress bool `json:"compress,omitempty"`
NoCompress bool `json:"no_compress,omitempty"`
Interval Duration `json:"interval"`
Sub json.RawMessage `json:"sub"`
}

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

Loading…
Cancel
Save