]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/aws/aws-sdk-go/aws/config.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / aws / aws-sdk-go / aws / config.go
index 5421b5d4e9ba2b6d8dc2f65df2ffb2bb19ad1617..10634d173d317ce8566cd5a950350e2976122c2b 100644 (file)
@@ -18,7 +18,7 @@ const UseServiceDefaultRetries = -1
 type RequestRetryer interface{}
 
 // A Config provides service configuration for service clients. By default,
-// all clients will use the defaults.DefaultConfig tructure.
+// all clients will use the defaults.DefaultConfig structure.
 //
 //     // Create Session with MaxRetry configuration to be shared by multiple
 //     // service clients.
@@ -45,8 +45,8 @@ type Config struct {
        // that overrides the default generated endpoint for a client. Set this
        // to `""` to use the default generated endpoint.
        //
-       // @note You must still provide a `Region` value when specifying an
-       //   endpoint for a client.
+       // Note: You must still provide a `Region` value when specifying an
+       // endpoint for a client.
        Endpoint *string
 
        // The resolver to use for looking up endpoints for AWS service clients
@@ -65,8 +65,8 @@ type Config struct {
        // noted. A full list of regions is found in the "Regions and Endpoints"
        // document.
        //
-       // @see http://docs.aws.amazon.com/general/latest/gr/rande.html
-       //   AWS Regions and Endpoints
+       // See http://docs.aws.amazon.com/general/latest/gr/rande.html for AWS
+       // Regions and Endpoints.
        Region *string
 
        // Set this to `true` to disable SSL when sending requests. Defaults
@@ -120,9 +120,10 @@ type Config struct {
        // will use virtual hosted bucket addressing when possible
        // (`http://BUCKET.s3.amazonaws.com/KEY`).
        //
-       // @note This configuration option is specific to the Amazon S3 service.
-       // @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
-       //   Amazon S3: Virtual Hosting of Buckets
+       // Note: This configuration option is specific to the Amazon S3 service.
+       //
+       // See http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
+       // for Amazon S3: Virtual Hosting of Buckets
        S3ForcePathStyle *bool
 
        // Set this to `true` to disable the SDK adding the `Expect: 100-Continue`
@@ -223,6 +224,28 @@ type Config struct {
        //      Key: aws.String("//foo//bar//moo"),
        //    })
        DisableRestProtocolURICleaning *bool
+
+       // EnableEndpointDiscovery will allow for endpoint discovery on operations that
+       // have the definition in its model. By default, endpoint discovery is off.
+       //
+       // Example:
+       //    sess := session.Must(session.NewSession(&aws.Config{
+       //         EnableEndpointDiscovery: aws.Bool(true),
+       //    }))
+       //
+       //    svc := s3.New(sess)
+       //    out, err := svc.GetObject(&s3.GetObjectInput {
+       //      Bucket: aws.String("bucketname"),
+       //      Key: aws.String("/foo/bar/moo"),
+       //    })
+       EnableEndpointDiscovery *bool
+
+       // DisableEndpointHostPrefix will disable the SDK's behavior of prefixing
+       // request endpoint hosts with modeled information.
+       //
+       // Disabling this feature is useful when you want to use local endpoints
+       // for testing that do not support the modeled host prefix pattern.
+       DisableEndpointHostPrefix *bool
 }
 
 // NewConfig returns a new Config pointer that can be chained with builder
@@ -377,6 +400,19 @@ func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config {
        return c
 }
 
+// WithEndpointDiscovery will set whether or not to use endpoint discovery.
+func (c *Config) WithEndpointDiscovery(t bool) *Config {
+       c.EnableEndpointDiscovery = &t
+       return c
+}
+
+// WithDisableEndpointHostPrefix will set whether or not to use modeled host prefix
+// when making requests.
+func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config {
+       c.DisableEndpointHostPrefix = &t
+       return c
+}
+
 // MergeIn merges the passed in configs into the existing config object.
 func (c *Config) MergeIn(cfgs ...*Config) {
        for _, other := range cfgs {
@@ -476,6 +512,14 @@ func mergeInConfig(dst *Config, other *Config) {
        if other.EnforceShouldRetryCheck != nil {
                dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck
        }
+
+       if other.EnableEndpointDiscovery != nil {
+               dst.EnableEndpointDiscovery = other.EnableEndpointDiscovery
+       }
+
+       if other.DisableEndpointHostPrefix != nil {
+               dst.DisableEndpointHostPrefix = other.DisableEndpointHostPrefix
+       }
 }
 
 // Copy will return a shallow copy of the Config object. If any additional