Package aws provides the core SDK's utilities and shared types. Use this package's utilities to simplify setting and reading API operations parameters.
Value and Pointer Conversion Utilities ¶This package includes a helper conversion utility for each scalar type the SDK's API use. These utilities make getting a pointer of the scalar, and dereferencing a pointer easier.
Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. The Pointer to value will safely dereference the pointer and return its value. If the pointer was nil, the scalar's zero value will be returned.
The value to pointer functions will be named after the scalar type. So get a *string from a string value use the "String" function. This makes it easy to to get pointer of a literal string value, because getting the address of a literal requires assigning the value to a variable first.
var strPtr *string // Without the SDK's conversion functions str := "my string" strPtr = &str // With the SDK's conversion functions strPtr = aws.String("my string") // Convert *string to string value str = aws.ToString(strPtr)
In addition to scalars the aws package also includes conversion utilities for map and slice for commonly types used in API parameters. The map and slice conversion functions use similar naming pattern as the scalar conversion functions.
var strPtrs []*string var strs []string = []string{"Go", "Gophers", "Go"} // Convert []string to []*string strPtrs = aws.StringSlice(strs) // Convert []*string to []string strs = aws.ToStringSlice(strPtrs)SDK Default HTTP Client ¶
The SDK will use the http.DefaultClient if a HTTP client is not provided to the SDK's Session, or service client constructor. This means that if the http.DefaultClient is modified by other components of your application the modifications will be picked up by the SDK as well.
In some cases this might be intended, but it is a better practice to create a custom HTTP Client to share explicitly through your application. You can configure the SDK to use the custom HTTP Client by setting the HTTPClient value of the SDK's Config type when creating a Session or service client.
Package aws provides core functionality for making requests to AWS services.
const ( AccountIDEndpointModeUnset AccountIDEndpointMode = "" AccountIDEndpointModePreferred = "preferred" AccountIDEndpointModeRequired = "required" AccountIDEndpointModeDisabled = "disabled" )
SDKName is the name of this AWS SDK
SDKVersion is the version of this SDK
This section is empty.
Bool returns a pointer value for the bool value passed in.
BoolMap returns a map of bool pointers from the values passed in.
BoolSlice returns a slice of bool pointers from the values passed in.
Byte returns a pointer value for the byte value passed in.
ByteMap returns a map of byte pointers from the values passed in.
ByteSlice returns a slice of byte pointers from the values passed in.
Duration returns a pointer value for the time.Duration value passed in.
DurationMap returns a map of time.Duration pointers from the values passed in.
DurationSlice returns a slice of time.Duration pointers from the values passed in.
Float32 returns a pointer value for the float32 value passed in.
Float32Map returns a map of float32 pointers from the values passed in.
Float32Slice returns a slice of float32 pointers from the values passed in.
Float64 returns a pointer value for the float64 value passed in.
Float64Map returns a map of float64 pointers from the values passed in.
Float64Slice returns a slice of float64 pointers from the values passed in.
func GetDisableHTTPS(options ...interface{}) (value bool, found bool)
GetDisableHTTPS takes a service's EndpointResolverOptions and returns the DisableHTTPS value. Returns boolean false if the provided options does not have a method to retrieve the DisableHTTPS.
func GetResolvedRegion(options ...interface{}) (value string, found bool)
GetResolvedRegion takes a service's EndpointResolverOptions and returns the ResolvedRegion value. Returns boolean false if the provided options does not have a method to retrieve the ResolvedRegion.
Int returns a pointer value for the int value passed in.
Int16 returns a pointer value for the int16 value passed in.
Int16Map returns a map of int16 pointers from the values passed in.
Int16Slice returns a slice of int16 pointers from the values passed in.
Int32 returns a pointer value for the int32 value passed in.
Int32Map returns a map of int32 pointers from the values passed in.
Int32Slice returns a slice of int32 pointers from the values passed in.
Int64 returns a pointer value for the int64 value passed in.
Int64Map returns a map of int64 pointers from the values passed in.
Int64Slice returns a slice of int64 pointers from the values passed in.
Int8 returns a pointer value for the int8 value passed in.
Int8Map returns a map of int8 pointers from the values passed in.
Int8Slice returns a slice of int8 pointers from the values passed in.
IntMap returns a map of int pointers from the values passed in.
func IntSlice(vs []int) []*int
IntSlice returns a slice of int pointers from the values passed in.
IsCredentialsProvider returns whether the target CredentialProvider is the same type as provider when comparing the implementation type.
If provider has a method IsCredentialsProvider(CredentialsProvider) bool it will be responsible for validating whether target matches the credential provider type.
When comparing the CredentialProvider implementations provider and target for equality, the following rules are used:
If provider is of type T and target is of type V, true if type *T is the same as type *V, otherwise false If provider is of type *T and target is of type V, true if type *T is the same as type *V, otherwise false If provider is of type T and target is of type *V, true if type *T is the same as type *V, otherwise false If provider is of type *T and target is of type *V,true if type *T is the same as type *V, otherwise false
String returns a pointer value for the string value passed in.
StringMap returns a map of string pointers from the values passed in.
StringSlice returns a slice of string pointers from the values passed in.
Time returns a pointer value for the time.Time value passed in.
TimeMap returns a map of time.Time pointers from the values passed in.
TimeSlice returns a slice of time.Time pointers from the values passed in.
ToBool returns bool value dereferenced if the passed in pointer was not nil. Returns a bool zero value if the pointer was nil.
ToBoolMap returns a map of bool values, that are dereferenced if the passed in pointer was not nil. The bool zero value is used if the pointer was nil.
ToBoolSlice returns a slice of bool values, that are dereferenced if the passed in pointer was not nil. Returns a bool zero value if the pointer was nil.
ToByte returns byte value dereferenced if the passed in pointer was not nil. Returns a byte zero value if the pointer was nil.
ToByteMap returns a map of byte values, that are dereferenced if the passed in pointer was not nil. The byte zero value is used if the pointer was nil.
ToByteSlice returns a slice of byte values, that are dereferenced if the passed in pointer was not nil. Returns a byte zero value if the pointer was nil.
ToDuration returns time.Duration value dereferenced if the passed in pointer was not nil. Returns a time.Duration zero value if the pointer was nil.
ToDurationMap returns a map of time.Duration values, that are dereferenced if the passed in pointer was not nil. The time.Duration zero value is used if the pointer was nil.
ToDurationSlice returns a slice of time.Duration values, that are dereferenced if the passed in pointer was not nil. Returns a time.Duration zero value if the pointer was nil.
ToFloat32 returns float32 value dereferenced if the passed in pointer was not nil. Returns a float32 zero value if the pointer was nil.
ToFloat32Map returns a map of float32 values, that are dereferenced if the passed in pointer was not nil. The float32 zero value is used if the pointer was nil.
ToFloat32Slice returns a slice of float32 values, that are dereferenced if the passed in pointer was not nil. Returns a float32 zero value if the pointer was nil.
ToFloat64 returns float64 value dereferenced if the passed in pointer was not nil. Returns a float64 zero value if the pointer was nil.
ToFloat64Map returns a map of float64 values, that are dereferenced if the passed in pointer was not nil. The float64 zero value is used if the pointer was nil.
ToFloat64Slice returns a slice of float64 values, that are dereferenced if the passed in pointer was not nil. Returns a float64 zero value if the pointer was nil.
ToInt returns int value dereferenced if the passed in pointer was not nil. Returns a int zero value if the pointer was nil.
ToInt16 returns int16 value dereferenced if the passed in pointer was not nil. Returns a int16 zero value if the pointer was nil.
ToInt16Map returns a map of int16 values, that are dereferenced if the passed in pointer was not nil. The int16 zero value is used if the pointer was nil.
ToInt16Slice returns a slice of int16 values, that are dereferenced if the passed in pointer was not nil. Returns a int16 zero value if the pointer was nil.
ToInt32 returns int32 value dereferenced if the passed in pointer was not nil. Returns a int32 zero value if the pointer was nil.
ToInt32Map returns a map of int32 values, that are dereferenced if the passed in pointer was not nil. The int32 zero value is used if the pointer was nil.
ToInt32Slice returns a slice of int32 values, that are dereferenced if the passed in pointer was not nil. Returns a int32 zero value if the pointer was nil.
ToInt64 returns int64 value dereferenced if the passed in pointer was not nil. Returns a int64 zero value if the pointer was nil.
ToInt64Map returns a map of int64 values, that are dereferenced if the passed in pointer was not nil. The int64 zero value is used if the pointer was nil.
ToInt64Slice returns a slice of int64 values, that are dereferenced if the passed in pointer was not nil. Returns a int64 zero value if the pointer was nil.
ToInt8 returns int8 value dereferenced if the passed in pointer was not nil. Returns a int8 zero value if the pointer was nil.
ToInt8Map returns a map of int8 values, that are dereferenced if the passed in pointer was not nil. The int8 zero value is used if the pointer was nil.
ToInt8Slice returns a slice of int8 values, that are dereferenced if the passed in pointer was not nil. Returns a int8 zero value if the pointer was nil.
ToIntMap returns a map of int values, that are dereferenced if the passed in pointer was not nil. The int zero value is used if the pointer was nil.
func ToIntSlice(vs []*int) []int
ToIntSlice returns a slice of int values, that are dereferenced if the passed in pointer was not nil. Returns a int zero value if the pointer was nil.
ToString returns string value dereferenced if the passed in pointer was not nil. Returns a string zero value if the pointer was nil.
ToStringMap returns a map of string values, that are dereferenced if the passed in pointer was not nil. The string zero value is used if the pointer was nil.
ToStringSlice returns a slice of string values, that are dereferenced if the passed in pointer was not nil. Returns a string zero value if the pointer was nil.
ToTime returns time.Time value dereferenced if the passed in pointer was not nil. Returns a time.Time zero value if the pointer was nil.
ToTimeMap returns a map of time.Time values, that are dereferenced if the passed in pointer was not nil. The time.Time zero value is used if the pointer was nil.
ToTimeSlice returns a slice of time.Time values, that are dereferenced if the passed in pointer was not nil. Returns a time.Time zero value if the pointer was nil.
ToUint returns uint value dereferenced if the passed in pointer was not nil. Returns a uint zero value if the pointer was nil.
ToUint16 returns uint16 value dereferenced if the passed in pointer was not nil. Returns a uint16 zero value if the pointer was nil.
ToUint16Map returns a map of uint16 values, that are dereferenced if the passed in pointer was not nil. The uint16 zero value is used if the pointer was nil.
ToUint16Slice returns a slice of uint16 values, that are dereferenced if the passed in pointer was not nil. Returns a uint16 zero value if the pointer was nil.
ToUint32 returns uint32 value dereferenced if the passed in pointer was not nil. Returns a uint32 zero value if the pointer was nil.
ToUint32Map returns a map of uint32 values, that are dereferenced if the passed in pointer was not nil. The uint32 zero value is used if the pointer was nil.
ToUint32Slice returns a slice of uint32 values, that are dereferenced if the passed in pointer was not nil. Returns a uint32 zero value if the pointer was nil.
ToUint64 returns uint64 value dereferenced if the passed in pointer was not nil. Returns a uint64 zero value if the pointer was nil.
ToUint64Map returns a map of uint64 values, that are dereferenced if the passed in pointer was not nil. The uint64 zero value is used if the pointer was nil.
ToUint64Slice returns a slice of uint64 values, that are dereferenced if the passed in pointer was not nil. Returns a uint64 zero value if the pointer was nil.
ToUint8 returns uint8 value dereferenced if the passed in pointer was not nil. Returns a uint8 zero value if the pointer was nil.
ToUint8Map returns a map of uint8 values, that are dereferenced if the passed in pointer was not nil. The uint8 zero value is used if the pointer was nil.
ToUint8Slice returns a slice of uint8 values, that are dereferenced if the passed in pointer was not nil. Returns a uint8 zero value if the pointer was nil.
ToUintMap returns a map of uint values, that are dereferenced if the passed in pointer was not nil. The uint zero value is used if the pointer was nil.
ToUintSlice returns a slice of uint values, that are dereferenced if the passed in pointer was not nil. Returns a uint zero value if the pointer was nil.
Uint returns a pointer value for the uint value passed in.
Uint16 returns a pointer value for the uint16 value passed in.
Uint16Map returns a map of uint16 pointers from the values passed in.
Uint16Slice returns a slice of uint16 pointers from the values passed in.
Uint32 returns a pointer value for the uint32 value passed in.
Uint32Map returns a map of uint32 pointers from the values passed in.
Uint32Slice returns a slice of uint32 pointers from the values passed in.
Uint64 returns a pointer value for the uint64 value passed in.
Uint64Map returns a map of uint64 pointers from the values passed in.
Uint64Slice returns a slice of uint64 pointers from the values passed in.
Uint8 returns a pointer value for the uint8 value passed in.
Uint8Map returns a map of uint8 pointers from the values passed in.
Uint8Slice returns a slice of uint8 pointers from the values passed in.
UintMap returns a map of uint pointers from the values passed in.
UintSlice returns a slice of uint pointers from the values passed in.
type AccountIDEndpointMode string
AccountIDEndpointMode controls how a resolved AWS account ID is handled for endpoint routing.
AdjustExpiresByCredentialsCacheStrategy is an interface for CredentialCache to allow CredentialsProvider to intercept adjustments to Credentials expiry based on expectations and use cases of CredentialsProvider.
Credential caches may use default implementation if nil.
type AnonymousCredentials struct{}
AnonymousCredentials provides a sentinel CredentialsProvider that should be used to instruct the SDK's signing middleware to not sign the request.
Using `nil` credentials when configuring an API client will achieve the same result. The AnonymousCredentials type allows you to configure the SDK's external config loading to not attempt to source credentials from the shared config or environment.
For example you can use this CredentialsProvider with an API client's Options to instruct the client not to sign a request for accessing public S3 bucket objects.
The following example demonstrates using the AnonymousCredentials to prevent SDK's external config loading attempt to resolve credentials.
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithCredentialsProvider(aws.AnonymousCredentials{}), ) if err != nil { log.Fatalf("failed to load config, %v", err) } client := s3.NewFromConfig(cfg)
Alternatively you can leave the API client Option's `Credential` member to nil. If using the `NewFromConfig` constructor you'll need to explicitly set the `Credentials` member to nil, if the external config resolved a credential provider.
client := s3.New(s3.Options{ // Credentials defaults to a nil value. })
This can also be configured for specific operations calls too.
cfg, err := config.LoadDefaultConfig(context.TODO()) if err != nil { log.Fatalf("failed to load config, %v", err) } client := s3.NewFromConfig(config) result, err := client.GetObject(context.TODO(), s3.GetObject{ Bucket: aws.String("example-bucket"), Key: aws.String("example-key"), }, func(o *s3.Options) { o.Credentials = nil // Or o.Credentials = aws.AnonymousCredentials{} })
Retrieve implements the CredentialsProvider interface, but will always return error, and cannot be used to sign a request. The AnonymousCredentials type is used as a sentinel type instructing the AWS request signing middleware to not sign a request.
ClientLogMode represents the logging mode of SDK clients. The client logging mode is a bit-field where each bit is a flag that describes the logging behavior for one or more client components. The entire 64-bit group is reserved for later expansion by the SDK.
Example: Setting ClientLogMode to enable logging of retries and requests
clientLogMode := aws.LogRetries | aws.LogRequest
Example: Adding an additional log mode to an existing ClientLogMode value
clientLogMode |= aws.LogResponse
const ( LogSigning ClientLogMode = 1 << (64 - 1 - iota) LogRetries LogRequest LogRequestWithBody LogResponse LogResponseWithBody LogDeprecatedUsage LogRequestEventMessage LogResponseEventMessage )
Supported ClientLogMode bits that can be configured to toggle logging of specific SDK events.
ClearDeprecatedUsage clears the DeprecatedUsage logging mode bit
ClearRequest clears the Request logging mode bit
ClearRequestEventMessage clears the RequestEventMessage logging mode bit
func (*ClientLogMode) ClearRequestWithBody ¶ added in v0.30.0ClearRequestWithBody clears the RequestWithBody logging mode bit
ClearResponse clears the Response logging mode bit
ClearResponseEventMessage clears the ResponseEventMessage logging mode bit
func (*ClientLogMode) ClearResponseWithBody ¶ added in v0.30.0ClearResponseWithBody clears the ResponseWithBody logging mode bit
ClearRetries clears the Retries logging mode bit
ClearSigning clears the Signing logging mode bit
IsDeprecatedUsage returns whether the DeprecatedUsage logging mode bit is set
IsRequest returns whether the Request logging mode bit is set
IsRequestEventMessage returns whether the RequestEventMessage logging mode bit is set
func (ClientLogMode) IsRequestWithBody ¶ added in v0.30.0IsRequestWithBody returns whether the RequestWithBody logging mode bit is set
IsResponse returns whether the Response logging mode bit is set
IsResponseEventMessage returns whether the ResponseEventMessage logging mode bit is set
func (ClientLogMode) IsResponseWithBody ¶ added in v0.30.0IsResponseWithBody returns whether the ResponseWithBody logging mode bit is set
IsRetries returns whether the Retries logging mode bit is set
IsSigning returns whether the Signing logging mode bit is set
A Config provides service configuration for service clients.
NewConfig returns a new Config pointer that can be chained with builder methods to set multiple configuration values inline without using pointers.
Copy will return a shallow copy of the Config object.
type CredentialProviderSource interface { ProviderSources() []CredentialSource }
CredentialProviderSource allows any credential provider to track all providers where a credential provider were sourced. For example, if the credentials came from a call to a role specified in the profile, this method will give the whole breadcrumb trail
type CredentialSource int
CredentialSource is the source of the credential provider. A provider can have multiple credential sources: For example, a provider that reads a profile, calls ECS to get credentials and then assumes a role using STS will have all these as part of its provider chain.
const ( CredentialSourceUndefined CredentialSource = iota CredentialSourceCode CredentialSourceEnvVars CredentialSourceEnvVarsSTSWebIDToken CredentialSourceSTSAssumeRole CredentialSourceSTSAssumeRoleSaml CredentialSourceSTSAssumeRoleWebID CredentialSourceSTSFederationToken CredentialSourceSTSSessionToken CredentialSourceProfile CredentialSourceProfileSourceProfile CredentialSourceProfileNamedProvider CredentialSourceProfileSTSWebIDToken CredentialSourceProfileSSO CredentialSourceSSO CredentialSourceProfileSSOLegacy CredentialSourceSSOLegacy CredentialSourceProfileProcess CredentialSourceProcess CredentialSourceHTTP CredentialSourceIMDS )
A Credentials is the AWS credentials value for individual credential fields.
Expired returns if the credentials have expired.
HasKeys returns if the credentials keys are set.
type CredentialsCache struct { }
CredentialsCache provides caching and concurrency safe credentials retrieval via the provider's retrieve method.
CredentialsCache will look for optional interfaces on the Provider to adjust how the credential cache handles credentials caching.
HandleFailRefreshCredentialsCacheStrategy - Allows provider to handle credential refresh failures. This could return an updated Credentials value, or attempt another means of retrieving credentials.
AdjustExpiresByCredentialsCacheStrategy - Allows provider to adjust how credentials Expires is modified. This could modify how the Credentials Expires is adjusted based on the CredentialsCache ExpiryWindow option. Such as providing a floor not to reduce the Expires below.
NewCredentialsCache returns a CredentialsCache that wraps provider. Provider is expected to not be nil. A variadic list of one or more functions can be provided to modify the CredentialsCache configuration. This allows for configuration of credential expiry window and jitter.
Invalidate will invalidate the cached credentials. The next call to Retrieve will cause the provider's Retrieve method to be called.
IsCredentialsProvider returns whether credential provider wrapped by CredentialsCache matches the target provider type.
ProviderSources returns a list of where the underlying credential provider has been sourced, if available. Returns empty if the provider doesn't implement the interface
Retrieve returns the credentials. If the credentials have already been retrieved, and not expired the cached credentials will be returned. If the credentials have not been retrieved yet, or expired the provider's Retrieve method will be called.
Returns and error if the provider's retrieve method returns an error.
type CredentialsCacheOptions struct { ExpiryWindow time.Duration ExpiryWindowJitterFrac float64 }
CredentialsCacheOptions are the options
A CredentialsProvider is the interface for any component which will provide credentials Credentials. A CredentialsProvider is required to manage its own Expired state, and what to be expired means.
A credentials provider implementation can be wrapped with a CredentialCache to cache the credential value retrieved. Without the cache the SDK will attempt to retrieve the credentials for every request.
CredentialsProviderFunc provides a helper wrapping a function value to satisfy the CredentialsProvider interface.
Retrieve delegates to the function value the CredentialsProviderFunc wraps.
DefaultsMode is the SDK defaults mode setting.
The DefaultsMode constants.
SetFromString sets the DefaultsMode value to one of the pre-defined constants that matches the provided string when compared using EqualFold. If the value does not match a known constant it will be set to as-is and the function will return false. As a special case, if the provided value is a zero-length string, the mode will be set to LegacyDefaultsMode.
type DualStackEndpointState uint
DualStackEndpointState is a constant to describe the dual-stack endpoint resolution behavior.
GetUseDualStackEndpoint takes a service's EndpointResolverOptions and returns the UseDualStackEndpoint value. Returns boolean false if the provided options does not have a method to retrieve the DualStackEndpointState.
Endpoint represents the endpoint a service client should make API operation calls to.
The SDK will automatically resolve these endpoints per API client using an internal endpoint resolvers. If you'd like to provide custom endpoint resolving behavior you can implement the EndpointResolver interface.
Deprecated: This structure was used with the global EndpointResolver interface, which has been deprecated in favor of service-specific endpoint resolution. See the deprecation docs on that interface for more information.
type EndpointDiscoveryEnableState uint
EndpointDiscoveryEnableState indicates if endpoint discovery is enabled, disabled, auto or unset state.
Default behavior (Auto or Unset) indicates operations that require endpoint discovery will use Endpoint Discovery by default. Operations that optionally use Endpoint Discovery will not use Endpoint Discovery unless EndpointDiscovery is explicitly enabled.
Enumeration values for EndpointDiscoveryEnableState
type EndpointNotFoundError struct { Err error }
EndpointNotFoundError is a sentinel error to indicate that the EndpointResolver implementation was unable to resolve an endpoint for the given service and region. Resolvers should use this to indicate that an API client should fallback and attempt to use it's internal default resolver to resolve the endpoint.
Error is the error message.
Unwrap returns the underlying error.
EndpointResolver is an endpoint resolver that can be used to provide or override an endpoint for the given service and region. API clients will attempt to use the EndpointResolver first to resolve an endpoint if available. If the EndpointResolver returns an EndpointNotFoundError error, API clients will fallback to attempting to resolve the endpoint using its internal default endpoint resolver.
Deprecated: The global endpoint resolution interface is deprecated. The API for endpoint resolution is now unique to each service and is set via the EndpointResolverV2 field on service client options. Setting a value for EndpointResolver on aws.Config or service client options will prevent you from using any endpoint-related service features released after the introduction of EndpointResolverV2. You may also encounter broken or unexpected behavior when using the old global interface with services that use many endpoint-related customizations such as S3.
EndpointResolverFunc wraps a function to satisfy the EndpointResolver interface.
Deprecated: The global endpoint resolution interface is deprecated. See deprecation docs on EndpointResolver.
ResolveEndpoint calls the wrapped function and returns the results.
type EndpointResolverWithOptions interface { ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error) }
EndpointResolverWithOptions is an endpoint resolver that can be used to provide or override an endpoint for the given service, region, and the service client's EndpointOptions. API clients will attempt to use the EndpointResolverWithOptions first to resolve an endpoint if available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error, API clients will fallback to attempting to resolve the endpoint using its internal default endpoint resolver.
Deprecated: The global endpoint resolution interface is deprecated. See deprecation docs on EndpointResolver.
type EndpointResolverWithOptionsFunc func(service, region string, options ...interface{}) (Endpoint, error)
EndpointResolverWithOptionsFunc wraps a function to satisfy the EndpointResolverWithOptions interface.
Deprecated: The global endpoint resolution interface is deprecated. See deprecation docs on EndpointResolver.
ResolveEndpoint calls the wrapped function and returns the results.
EndpointSource is the endpoint source type.
Deprecated: The global Endpoint structure is deprecated.
type ExecutionEnvironmentID string
ExecutionEnvironmentID is the AWS execution environment runtime identifier.
type FIPSEndpointState uint
FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior.
const ( FIPSEndpointStateUnset FIPSEndpointState = iota FIPSEndpointStateEnabled FIPSEndpointStateDisabled )
GetUseFIPSEndpoint takes a service's EndpointResolverOptions and returns the UseDualStackEndpoint value. Returns boolean false if the provided options does not have a method to retrieve the DualStackEndpointState.
HTTPClient provides the interface to provide custom HTTPClients. Generally *http.Client is sufficient for most use cases. The HTTPClient should not follow 301 or 302 redirects.
type HandleFailRefreshCredentialsCacheStrategy ¶ added in v1.16.0HandleFailRefreshCredentialsCacheStrategy is an interface for CredentialsCache to allow CredentialsProvider how failed to refresh credentials is handled.
type MissingRegionError struct{}
MissingRegionError is an error that is returned if region configuration value was not found.
NopRetryer provides a RequestRetryDecider implementation that will flag all attempt errors as not retryable, with a max attempts of 1.
GetAttemptToken returns a stub function that does nothing.
GetInitialToken returns a stub function that does nothing.
GetRetryToken returns a stub function that does nothing.
IsErrorRetryable returns false for all error values.
MaxAttempts always returns 1 for the original attempt.
RetryDelay is not valid for the NopRetryer. Will always return error.
type RequestCanceledError struct { Err error }
RequestCanceledError is the error that will be returned by an API request that was canceled. Requests given a Context may return this error when canceled.
CanceledError returns true to satisfy interfaces checking for canceled errors.
Unwrap returns the underlying error, if there was one.
type RequestChecksumCalculation int
RequestChecksumCalculation controls request checksum calculation workflow
const ( RequestChecksumCalculationUnset RequestChecksumCalculation = iota RequestChecksumCalculationWhenSupported RequestChecksumCalculationWhenRequired )
type ResponseChecksumValidation int
ResponseChecksumValidation controls response checksum validation workflow
const ( ResponseChecksumValidationUnset ResponseChecksumValidation = iota ResponseChecksumValidationWhenSupported ResponseChecksumValidationWhenRequired )
RetryMode provides the mode the API client will use to create a retryer based on.
const ( RetryModeStandard RetryMode = "standard" RetryModeAdaptive RetryMode = "adaptive" )
ParseRetryMode attempts to parse a RetryMode from the given string. Returning error if the value is not a known RetryMode.
Retryer is an interface to determine if a given error from a attempt should be retried, and if so what backoff delay to apply. The default implementation used by most services is the retry package's Standard type. Which contains basic retry logic using exponential backoff.
RetryerV2 is an interface to determine if a given error from an attempt should be retried, and if so what backoff delay to apply. The default implementation used by most services is the retry package's Standard type. Which contains basic retry logic using exponential backoff.
RetryerV2 replaces the Retryer interface, deprecating the GetInitialToken method in favor of GetAttemptToken which takes a context, and can return an error.
The SDK's retry package's Attempt middleware, and utilities will always wrap a Retryer as a RetryerV2. Delegating to GetInitialToken, only if GetAttemptToken is not implemented.
RuntimeEnvironment is a collection of values that are determined at runtime based on the environment that the SDK is executing in. Some of these values may or may not be present based on the executing environment and certain SDK configuration properties that drive whether these values are populated..
Ternary is an enum allowing an unknown or none state in addition to a bool's true and false.
const ( UnknownTernary Ternary = iota FalseTernary TrueTernary )
Enumerations for the values of the Ternary type.
BoolTernary returns a true or false Ternary value for the bool provided.
Bool returns true if the value is TrueTernary, false otherwise.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4