Skip to content

Commit 2e95db9

Browse files
authored
Support for yaml in S3Config (#31)
* Support for yaml in S3Config * Support for yaml RemoteClientConfig sub structures * Fix broken test
1 parent 5dd1514 commit 2e95db9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

remoteconfig_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ func (s *RemoteConfigSuite) TestLoadConfigFromURLError() {
587587
c := &SQSQueueConfig{}
588588
err := LoadConfigFromURL("invalid", c)
589589
assert.NotNil(s.T(), err)
590-
assert.EqualError(s.T(), err, "Get invalid: unsupported protocol scheme \"\"")
590+
assert.EqualError(s.T(), err, "Get \"invalid\": unsupported protocol scheme \"\"")
591591
}
592592

593593
func (s *RemoteConfigSuite) TestReadJSONValidate() {

s3_config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const (
1010
)
1111

1212
type S3Config struct {
13-
Endpoint *string `json:"endpoint,omitempty" remoteconfig:"optional"`
14-
Bucket *string `json:"bucket,omitempty"` // i.e. bucket
15-
Region *AWSRegion `json:"region,omitempty"` // i.e. us-west-2
16-
Expiry *uint `json:"expiry,omitempty" remoteconfig:"optional"` // i.e. 60
13+
Endpoint *string `json:"endpoint,omitempty" yaml:"endpoint,omitempty" remoteconfig:"optional"`
14+
Bucket *string `json:"bucket,omitempty" yaml:"bucket,omitempty"` // i.e. bucket
15+
Region *AWSRegion `json:"region,omitempty" yaml:"region,omitempty"` // i.e. us-west-2
16+
Expiry *uint `json:"expiry,omitempty" yaml:"expiry,omitempty" remoteconfig:"optional"` // i.e. 60
1717
}
1818

1919
func (c S3Config) GetEndpoint() string {

s3_endpoint_expiry_config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const (
55
)
66

77
type S3EndpointExpiryConfig struct {
8-
Endpoint *string `json:"endpoint,omitempty" remoteconfig:"optional"`
9-
Expiry *uint `json:"expiry,omitempty" remoteconfig:"optional"`
8+
Endpoint *string `json:"endpoint,omitempty" yaml:"endpoint,omitempty" remoteconfig:"optional"`
9+
Expiry *uint `json:"expiry,omitempty" yaml:"expiry,omitempty" remoteconfig:"optional"`
1010
}
1111

1212
func (c S3EndpointExpiryConfig) GetEndpoint() string {

0 commit comments

Comments
 (0)