Skip to content

Commit 247f42f

Browse files
authored
Merge pull request #31 from sethvargo/sethvargo/version
Add format_version
2 parents 1949afd + 4783813 commit 247f42f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

s3.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type S3 struct {
2727
Period uint `mapstructure:"period"`
2828
GzipLevel uint `mapstructure:"gzip_level"`
2929
Format string `mapstructure:"format"`
30+
FormatVersion uint `mapstructure:"format_version"`
3031
ResponseCondition string `mapstructure:"response_condition"`
3132
TimestampFormat string `mapstructure:"timestamp_format"`
3233
Redundancy S3Redundancy `mapstructure:"redundancy"`
@@ -94,6 +95,7 @@ type CreateS3Input struct {
9495
Period uint `form:"period,omitempty"`
9596
GzipLevel uint `form:"gzip_level,omitempty"`
9697
Format string `form:"format,omitempty"`
98+
FormatVersion uint `form:"format_version,omitempty"`
9799
ResponseCondition string `form:"response_condition,omitempty"`
98100
TimestampFormat string `form:"timestamp_format,omitempty"`
99101
Redundancy S3Redundancy `form:"redundancy,omitempty"`
@@ -179,6 +181,7 @@ type UpdateS3Input struct {
179181
Period uint `form:"period,omitempty"`
180182
GzipLevel uint `form:"gzip_level,omitempty"`
181183
Format string `form:"format,omitempty"`
184+
FormatVersion uint `form:"format_version,omitempty"`
182185
ResponseCondition string `form:"response_condition,omitempty"`
183186
TimestampFormat string `form:"timestamp_format,omitempty"`
184187
Redundancy S3Redundancy `form:"redundancy,omitempty"`

s3_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func TestClient_S3s(t *testing.T) {
2626
Period: 12,
2727
GzipLevel: 9,
2828
Format: "format",
29+
FormatVersion: 2,
2930
TimestampFormat: "%Y",
3031
Redundancy: S3RedundancyReduced,
3132
})
@@ -78,6 +79,9 @@ func TestClient_S3s(t *testing.T) {
7879
if s3.Format != "format" {
7980
t.Errorf("bad format: %q", s3.Format)
8081
}
82+
if s3.FormatVersion != 2 {
83+
t.Errorf("bad format_version: %q", s3.FormatVersion)
84+
}
8185
if s3.TimestampFormat != "%Y" {
8286
t.Errorf("bad timestamp_format: %q", s3.TimestampFormat)
8387
}
@@ -139,6 +143,9 @@ func TestClient_S3s(t *testing.T) {
139143
if s3.Format != ns3.Format {
140144
t.Errorf("bad format: %q", s3.Format)
141145
}
146+
if s3.FormatVersion != ns3.FormatVersion {
147+
t.Errorf("bad format_version: %q", s3.FormatVersion)
148+
}
142149
if s3.TimestampFormat != ns3.TimestampFormat {
143150
t.Errorf("bad timestamp_format: %q", s3.TimestampFormat)
144151
}

0 commit comments

Comments
 (0)