Sha256: edecf8c9f9dc9d6c80d2f8cf1476c5e4eda6a1122ea9ce372adeb4ef9b9da10e

Contents?: true

Size: 1.63 KB

Versions: 16

Compression:

Stored size: 1.63 KB

Contents

// Code generated by github.com/aws/aws-sdk-go-v2/internal/codegen/cmd/defaultsconfig. DO NOT EDIT.

package defaults

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/aws"
	"time"
)

// GetModeConfiguration returns the default Configuration descriptor for the given mode.
//
// Supports the following modes: cross-region, in-region, mobile, standard
func GetModeConfiguration(mode aws.DefaultsMode) (Configuration, error) {
	var mv aws.DefaultsMode
	mv.SetFromString(string(mode))

	switch mv {
	case aws.DefaultsModeCrossRegion:
		settings := Configuration{
			ConnectTimeout:        aws.Duration(3100 * time.Millisecond),
			RetryMode:             aws.RetryMode("standard"),
			TLSNegotiationTimeout: aws.Duration(3100 * time.Millisecond),
		}
		return settings, nil
	case aws.DefaultsModeInRegion:
		settings := Configuration{
			ConnectTimeout:        aws.Duration(1100 * time.Millisecond),
			RetryMode:             aws.RetryMode("standard"),
			TLSNegotiationTimeout: aws.Duration(1100 * time.Millisecond),
		}
		return settings, nil
	case aws.DefaultsModeMobile:
		settings := Configuration{
			ConnectTimeout:        aws.Duration(30000 * time.Millisecond),
			RetryMode:             aws.RetryMode("standard"),
			TLSNegotiationTimeout: aws.Duration(30000 * time.Millisecond),
		}
		return settings, nil
	case aws.DefaultsModeStandard:
		settings := Configuration{
			ConnectTimeout:        aws.Duration(3100 * time.Millisecond),
			RetryMode:             aws.RetryMode("standard"),
			TLSNegotiationTimeout: aws.Duration(3100 * time.Millisecond),
		}
		return settings, nil
	default:
		return Configuration{}, fmt.Errorf("unsupported defaults mode: %v", mode)
	}
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.3.6 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.3.5 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.3.4 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.3.2 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.3.1 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.3.0 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.2.1 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.2.0 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.1.1 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.1.0 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.0.2 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.0.1 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go
ruby_snowflake_client-1.0.0 ext/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go