Involved Source Filesdecode.godefaults.godep_service_ids.go
Package endpoints provides the types and functionality for defining regions
and endpoints, as well as querying those definitions.
The SDK's Regions and Endpoints metadata is code generated into the endpoints
package, and is accessible via the DefaultResolver function. This function
returns a endpoint Resolver will search the metadata and build an associated
endpoint if one is found. The default resolver will search all partitions
known by the SDK. e.g AWS Standard (aws), AWS China (aws-cn), and
AWS GovCloud (US) (aws-us-gov).
.
Enumerating Regions and Endpoint Metadata
Casting the Resolver returned by DefaultResolver to a EnumPartitions interface
will allow you to get access to the list of underlying Partitions with the
Partitions method. This is helpful if you want to limit the SDK's endpoint
resolving to a single partition, or enumerate regions, services, and endpoints
in the partition.
resolver := endpoints.DefaultResolver()
partitions := resolver.(endpoints.EnumPartitions).Partitions()
for _, p := range partitions {
fmt.Println("Regions for", p.ID())
for id, _ := range p.Regions() {
fmt.Println("*", id)
}
fmt.Println("Services for", p.ID())
for id, _ := range p.Services() {
fmt.Println("*", id)
}
}
Using Custom Endpoints
The endpoints package also gives you the ability to use your own logic how
endpoints are resolved. This is a great way to define a custom endpoint
for select services, without passing that logic down through your code.
If a type implements the Resolver interface it can be used to resolve
endpoints. To use this with the SDK's Session and Config set the value
of the type to the EndpointsResolver field of aws.Config when initializing
the session, or service client.
In addition the ResolverFunc is a wrapper for a func matching the signature
of Resolver.EndpointFor, converting it to a type that satisfies the
Resolver interface.
myCustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) {
if service == endpoints.S3ServiceID {
return endpoints.ResolvedEndpoint{
URL: "s3.custom.endpoint.com",
SigningRegion: "custom-signing-region",
}, nil
}
return endpoints.DefaultResolver().EndpointFor(service, region, optFns...)
}
sess := session.Must(session.NewSession(&aws.Config{
Region: aws.String("us-west-2"),
EndpointResolver: endpoints.ResolverFunc(myCustomResolver),
}))
endpoints.golegacy_regions.gov3model.go
Code Examples
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/endpoints"
)
func main() {
resolver := endpoints.DefaultResolver()
partitions := resolver.(endpoints.EnumPartitions).Partitions()
for _, p := range partitions {
fmt.Println("Regions for", p.ID())
for id := range p.Regions() {
fmt.Println("*", id)
}
fmt.Println("Services for", p.ID())
for id := range p.Services() {
fmt.Println("*", id)
}
}
}
package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/sqs"
)
func main() {
myCustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) {
if service == endpoints.S3ServiceID {
return endpoints.ResolvedEndpoint{
URL: "s3.custom.endpoint.com",
SigningRegion: "custom-signing-region",
}, nil
}
return endpoints.DefaultResolver().EndpointFor(service, region, optFns...)
}
sess := session.Must(session.NewSession(&aws.Config{
Region: aws.String("us-west-2"),
EndpointResolver: endpoints.ResolverFunc(myCustomResolver),
}))
// Create the S3 service client with the shared session. This will
// automatically use the S3 custom endpoint configured in the custom
// endpoint resolver wrapping the default endpoint resolver.
s3Svc := s3.New(sess)
// Operation calls will be made to the custom endpoint.
s3Svc.GetObject(&s3.GetObjectInput{
Bucket: aws.String("myBucket"),
Key: aws.String("myObjectKey"),
})
// Create the SQS service client with the shared session. This will
// fallback to the default endpoint resolver because the customization
// passes any non S3 service endpoint resolve to the default resolver.
sqsSvc := sqs.New(sess)
// Operation calls will be made to the default endpoint for SQS for the
// region configured.
sqsSvc.ReceiveMessage(&sqs.ReceiveMessageInput{
QueueUrl: aws.String("my-queue-url"),
})
}
Package-Level Type Names (total 29, in which 15 are exported)
A Endpoint provides information about endpoints, and provides the ability
to resolve that endpoint for the service, and the region the endpoint
represents.
idstringp*partitionserviceIDstring
ID returns the identifier for an endpoint.
ResolveEndpoint resolves an endpoint from the context of a service and
region the endpoint represents. See Partition.EndpointFor for usage and
errors that can be returned.
ServiceID returns the identifier the endpoint belongs to.
func Service.Endpoints() map[string]Endpoint
A EndpointNotFoundError is returned when in StrictMatching mode, and the
endpoint for the service and region cannot be found in any of the partitions.
PartitionstringRegionstringServicestringawsErrorawsError
Returns the short phrase depicting the classification of the error.
( T) Error() builtin.string
Returns the error details message.
Returns the original error if one was set. Nil is returned if not set.
T : github.com/aws/aws-sdk-go/aws/awserr.Error
T : error
T : awsError
T : github.com/aws/aws-sdk-go/aws/awserr.awsError
EnumPartitions a provides a way to retrieve the underlying partitions that
make up the SDK's default Resolver, or any resolver decoded from a model
file.
Use this interface with DefaultResolver and DecodeModels to get the list of
Partitions.
( T) Partitions() []Partitionpartitions
Options provide the configuration needed to direct how the
endpoints will be resolved.
DisableSSL forces the endpoint to be resolved as HTTP.
instead of HTTPS if the service supports it.
Enables resolving a service endpoint based on the region provided if the
service does not exist. The service endpoint ID will be used as the service
domain name prefix. By default the endpoint resolver requires the service
to be known when resolving endpoints.
If resolving an endpoint on the partition list the provided region will
be used to determine which partition's domain name pattern to the service
endpoint ID with. If both the service and region are unknown and resolving
the endpoint on partition list an UnknownEndpointError error will be returned.
If resolving and endpoint on a partition specific resolver that partition's
domain name pattern will be used with the service endpoint ID. If both
region and service do not exist when resolving an endpoint on a specific
partition the partition's domain pattern will be used to combine the
endpoint and region together.
This option is ignored if StrictMatching is enabled.
S3 Regional Endpoint flag helps with resolving the S3 endpoint
STS Regional Endpoint flag helps with resolving the STS endpoint
Enables strict matching of services and regions resolved endpoints.
If the partition doesn't enumerate the exact service and region an
error will be returned. This option will prevent returning endpoints
that look valid, but may not resolve to any real endpoint.
Sets the resolver to resolve the endpoint as a dualstack endpoint
for the service. If dualstack support for a service is not known and
StrictMatching is not enabled a dualstack endpoint for the service will
be returned. This endpoint may not be valid. If StrictMatching is
enabled only services that are known to support dualstack will return
dualstack endpoints.
Set combines all of the option functions together.
func DisableSSLOption(o *Options)
func ResolveUnknownServiceOption(o *Options)
func StrictMatchingOption(o *Options)
func STSRegionalEndpointOption(o *Options)
func UseDualStackOption(o *Options)
A Partition provides the ability to enumerate the partition's regions
and services.
dnsSuffixstringidstringp*partition
DNSSuffix returns the base domain name of the partition.
EndpointFor attempts to resolve the endpoint based on service and region.
See Options for information on configuring how the endpoint is resolved.
If the service cannot be found in the metadata the UnknownServiceError
error will be returned. This validation will occur regardless if
StrictMatching is enabled. To enable resolving unknown services set the
"ResolveUnknownService" option to true. When StrictMatching is disabled
this option allows the partition resolver to resolve a endpoint based on
the service endpoint ID provided.
When resolving endpoints you can choose to enable StrictMatching. This will
require the provided service and region to be known by the partition.
If the endpoint cannot be strictly resolved an error will be returned. This
mode is useful to ensure the endpoint resolved is valid. Without
StrictMatching enabled the endpoint returned may look valid but may not work.
StrictMatching requires the SDK to be updated if you want to take advantage
of new regions and services expansions.
Errors that can be returned.
* UnknownServiceError
* UnknownEndpointError
ID returns the identifier of the partition.
Regions returns a map of Regions indexed by their ID. This is useful for
enumerating over the regions in a partition.
Services returns a map of Service indexed by their ID. This is useful for
enumerating over the services in a partition.
T : Resolver
func AwsCnPartition() Partition
func AwsIsoBPartition() Partition
func AwsIsoPartition() Partition
func AwsPartition() Partition
func AwsUsGovPartition() Partition
func DefaultPartitions() []Partition
func PartitionForRegion(ps []Partition, regionID string) (Partition, bool)
func EnumPartitions.Partitions() []Partition
func PartitionForRegion(ps []Partition, regionID string) (Partition, bool)
func RegionsForService(ps []Partition, partitionID, serviceID string) (map[string]Region, bool)
A Region provides information about a region, and ability to resolve an
endpoint from the context of a region, given a service.
descstringidstringp*partition
Description returns the region's description. The region description
is free text, it can be empty, and it may change between SDK releases.
ID returns the region's identifier.
ResolveEndpoint resolves an endpoint from the context of the region given
a service. See Partition.EndpointFor for usage and errors that can be returned.
Services returns a list of all services that are known to be in this region.
func RegionsForService(ps []Partition, partitionID, serviceID string) (map[string]Region, bool)
func Partition.Regions() map[string]Region
func Service.Regions() map[string]Region
A ResolvedEndpoint is an endpoint that has been resolved based on a partition
service, and region.
The endpoint partition
The signing method that should be used for signing requests.
The service name that should be used for signing requests.
States that the signing name for this endpoint was derived from metadata
passed in, but was not explicitly modeled.
The region that should be used for signing requests.
The endpoint URL
func Endpoint.ResolveEndpoint(opts ...func(*Options)) (ResolvedEndpoint, error)
func Partition.EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error)
func Region.ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error)
func Resolver.EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error)
func ResolverFunc.EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error)
func Service.ResolveEndpoint(region string, opts ...func(*Options)) (ResolvedEndpoint, error)
func github.com/aws/aws-sdk-go/aws/session.(*Session).resolveEndpoint(service, region string, cfg *aws.Config) (ResolvedEndpoint, error)
ResolverFunc is a helper utility that wraps a function so it satisfies the
Resolver interface. This is useful when you want to add additional endpoint
resolving logic, or stub out specific endpoints with custom values.
EndpointFor wraps the ResolverFunc function to satisfy the Resolver interface.
T : Resolver
A Service provides information about a service, and ability to resolve an
endpoint from the context of a service, given a region.
idstringp*partition
Endpoints returns a map of Endpoints indexed by their ID for all known
endpoints for a service.
A region is the AWS region the service exists in. Whereas a Endpoint is
an URL that can be resolved to a instance of a service.
ID returns the identifier for the service.
Regions returns a map of Regions that the service is present in.
A region is the AWS region the service exists in. Whereas a Endpoint is
an URL that can be resolved to a instance of a service.
ResolveEndpoint resolves an endpoint from the context of a service given
a region. See Partition.EndpointFor for usage and errors that can be returned.
func Partition.Services() map[string]Service
func Region.Services() map[string]Service
A UnknownEndpointError is returned when in StrictMatching mode and the
service is valid, but the region does not resolve to an endpoint. Includes
a list of all known endpoints for the service.
Known[]stringPartitionstringRegionstringServicestringawsErrorawsError
Returns the short phrase depicting the classification of the error.
String returns the string representation of the error.
Returns the error details message.
Returns the original error if one was set. Nil is returned if not set.
String returns the string representation of the error.
T : github.com/aws/aws-sdk-go/aws/awserr.Error
T : error
T : expvar.Var
T : fmt.Stringer
T : awsError
T : github.com/aws/aws-sdk-go/aws/awserr.awsError
T : context.stringer
T : runtime.stringer
func NewUnknownEndpointError(p, s, r string, known []string) UnknownEndpointError
A UnknownServiceError is returned when the service does not resolve to an
endpoint. Includes a list of all known services for the partition. Returned
when a partition does not support the service.
Known[]stringPartitionstringServicestringawsErrorawsError
Returns the short phrase depicting the classification of the error.
String returns the string representation of the error.
Returns the error details message.
Returns the original error if one was set. Nil is returned if not set.
String returns the string representation of the error.
T : github.com/aws/aws-sdk-go/aws/awserr.Error
T : error
T : expvar.Var
T : fmt.Stringer
T : awsError
T : github.com/aws/aws-sdk-go/aws/awserr.awsError
T : context.stringer
T : runtime.stringer
func NewUnknownServiceError(p, s string, known []string) UnknownServiceError
awsErrorawsError
Returns the short phrase depicting the classification of the error.
( T) Error() builtin.string
Returns the error details message.
Returns the original error if one was set. Nil is returned if not set.
T : github.com/aws/aws-sdk-go/aws/awserr.Error
T : error
T : awsError
T : github.com/aws/aws-sdk-go/aws/awserr.awsError
func newDecodeModelError(msg string, err error) decodeModelError
Regexp*regexp.Regexp
// empty-width conditions required at start of match
// as passed to Compile
This field can be modified by the Longest method,
but it is otherwise read-only.
// whether regexp prefers leftmost-longest match
// size of recorded match lengths
Regexp.maxBitStateLenint
// minimum length of the input in bytes
// pool for machines
Regexp.numSubexpint
// onepass program or nil
// required prefix in unanchored matches
// prefix, as a []byte
// prefix is the entire regexp
// pc for last rune in prefix
// first rune in prefix
// compiled program
Regexp.subexpNames[]string
Copy returns a new Regexp object copied from re.
Calling Longest on one copy does not affect another.
Deprecated: In earlier releases, when using a Regexp in multiple goroutines,
giving each goroutine its own copy helped to avoid lock contention.
As of Go 1.12, using Copy is no longer necessary to avoid lock contention.
Copy may still be appropriate if the reason for its use is to make
two copies with different Longest settings.
Expand appends template to dst and returns the result; during the
append, Expand replaces variables in the template with corresponding
matches drawn from src. The match slice should have been returned by
FindSubmatchIndex.
In the template, a variable is denoted by a substring of the form
$name or ${name}, where name is a non-empty sequence of letters,
digits, and underscores. A purely numeric name like $1 refers to
the submatch with the corresponding index; other names refer to
capturing parentheses named with the (?P<name>...) syntax. A
reference to an out of range or unmatched index or a name that is not
present in the regular expression is replaced with an empty slice.
In the $name form, name is taken to be as long as possible: $1x is
equivalent to ${1x}, not ${1}x, and, $10 is equivalent to ${10}, not ${1}0.
To insert a literal $ in the output, use $$ in the template.
ExpandString is like Expand but the template and source are strings.
It appends to and returns a byte slice in order to give the calling
code control over allocation.
Find returns a slice holding the text of the leftmost match in b of the regular expression.
A return value of nil indicates no match.
FindAll is the 'All' version of Find; it returns a slice of all successive
matches of the expression, as defined by the 'All' description in the
package comment.
A return value of nil indicates no match.
FindAllIndex is the 'All' version of FindIndex; it returns a slice of all
successive matches of the expression, as defined by the 'All' description
in the package comment.
A return value of nil indicates no match.
FindAllString is the 'All' version of FindString; it returns a slice of all
successive matches of the expression, as defined by the 'All' description
in the package comment.
A return value of nil indicates no match.
FindAllStringIndex is the 'All' version of FindStringIndex; it returns a
slice of all successive matches of the expression, as defined by the 'All'
description in the package comment.
A return value of nil indicates no match.
FindAllStringSubmatch is the 'All' version of FindStringSubmatch; it
returns a slice of all successive matches of the expression, as defined by
the 'All' description in the package comment.
A return value of nil indicates no match.
FindAllStringSubmatchIndex is the 'All' version of
FindStringSubmatchIndex; it returns a slice of all successive matches of
the expression, as defined by the 'All' description in the package
comment.
A return value of nil indicates no match.
FindAllSubmatch is the 'All' version of FindSubmatch; it returns a slice
of all successive matches of the expression, as defined by the 'All'
description in the package comment.
A return value of nil indicates no match.
FindAllSubmatchIndex is the 'All' version of FindSubmatchIndex; it returns
a slice of all successive matches of the expression, as defined by the
'All' description in the package comment.
A return value of nil indicates no match.
FindIndex returns a two-element slice of integers defining the location of
the leftmost match in b of the regular expression. The match itself is at
b[loc[0]:loc[1]].
A return value of nil indicates no match.
FindReaderIndex returns a two-element slice of integers defining the
location of the leftmost match of the regular expression in text read from
the RuneReader. The match text was found in the input stream at
byte offset loc[0] through loc[1]-1.
A return value of nil indicates no match.
FindReaderSubmatchIndex returns a slice holding the index pairs
identifying the leftmost match of the regular expression of text read by
the RuneReader, and the matches, if any, of its subexpressions, as defined
by the 'Submatch' and 'Index' descriptions in the package comment. A
return value of nil indicates no match.
FindString returns a string holding the text of the leftmost match in s of the regular
expression. If there is no match, the return value is an empty string,
but it will also be empty if the regular expression successfully matches
an empty string. Use FindStringIndex or FindStringSubmatch if it is
necessary to distinguish these cases.
FindStringIndex returns a two-element slice of integers defining the
location of the leftmost match in s of the regular expression. The match
itself is at s[loc[0]:loc[1]].
A return value of nil indicates no match.
FindStringSubmatch returns a slice of strings holding the text of the
leftmost match of the regular expression in s and the matches, if any, of
its subexpressions, as defined by the 'Submatch' description in the
package comment.
A return value of nil indicates no match.
FindStringSubmatchIndex returns a slice holding the index pairs
identifying the leftmost match of the regular expression in s and the
matches, if any, of its subexpressions, as defined by the 'Submatch' and
'Index' descriptions in the package comment.
A return value of nil indicates no match.
FindSubmatch returns a slice of slices holding the text of the leftmost
match of the regular expression in b and the matches, if any, of its
subexpressions, as defined by the 'Submatch' descriptions in the package
comment.
A return value of nil indicates no match.
FindSubmatchIndex returns a slice holding the index pairs identifying the
leftmost match of the regular expression in b and the matches, if any, of
its subexpressions, as defined by the 'Submatch' and 'Index' descriptions
in the package comment.
A return value of nil indicates no match.
LiteralPrefix returns a literal string that must begin any match
of the regular expression re. It returns the boolean true if the
literal string comprises the entire regular expression.
Longest makes future searches prefer the leftmost-longest match.
That is, when matching against text, the regexp returns a match that
begins as early as possible in the input (leftmost), and among those
it chooses a match that is as long as possible.
This method modifies the Regexp and may not be called concurrently
with any other methods.
Match reports whether the byte slice b
contains any match of the regular expression re.
MatchReader reports whether the text returned by the RuneReader
contains any match of the regular expression re.
MatchString reports whether the string s
contains any match of the regular expression re.
NumSubexp returns the number of parenthesized subexpressions in this Regexp.
ReplaceAll returns a copy of src, replacing matches of the Regexp
with the replacement text repl. Inside repl, $ signs are interpreted as
in Expand, so for instance $1 represents the text of the first submatch.
ReplaceAllFunc returns a copy of src in which all matches of the
Regexp have been replaced by the return value of function repl applied
to the matched byte slice. The replacement returned by repl is substituted
directly, without using Expand.
ReplaceAllLiteral returns a copy of src, replacing matches of the Regexp
with the replacement bytes repl. The replacement repl is substituted directly,
without using Expand.
ReplaceAllLiteralString returns a copy of src, replacing matches of the Regexp
with the replacement string repl. The replacement repl is substituted directly,
without using Expand.
ReplaceAllString returns a copy of src, replacing matches of the Regexp
with the replacement string repl. Inside repl, $ signs are interpreted as
in Expand, so for instance $1 represents the text of the first submatch.
ReplaceAllStringFunc returns a copy of src in which all matches of the
Regexp have been replaced by the return value of function repl applied
to the matched substring. The replacement returned by repl is substituted
directly, without using Expand.
Split slices s into substrings separated by the expression and returns a slice of
the substrings between those expression matches.
The slice returned by this method consists of all the substrings of s
not contained in the slice returned by FindAllString. When called on an expression
that contains no metacharacters, it is equivalent to strings.SplitN.
Example:
s := regexp.MustCompile("a*").Split("abaabaccadaaae", 5)
// s: ["", "b", "b", "c", "cadaaae"]
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the unsplit remainder.
n == 0: the result is nil (zero substrings)
n < 0: all substrings
String returns the source text used to compile the regular expression.
SubexpIndex returns the index of the first subexpression with the given name,
or -1 if there is no subexpression with that name.
Note that multiple subexpressions can be written using the same name, as in
(?P<bob>a+)(?P<bob>b+), which declares two subexpressions named "bob".
In this case, SubexpIndex returns the index of the leftmost such subexpression
in the regular expression.
SubexpNames returns the names of the parenthesized subexpressions
in this Regexp. The name for the first sub-expression is names[1],
so that if m is a match slice, the name for m[i] is SubexpNames()[i].
Since the Regexp as a whole cannot be named, names[0] is always
the empty string. The slice should not be modified.
(*T) UnmarshalJSON(b []byte) (err error)
allMatches calls deliver at most n times
with the location of successive matches in the input text.
The input text is b if non-nil, otherwise s.
backtrack runs a backtracking search of prog on the input starting at pos.
doExecute finds the leftmost match in the input, appends the position
of its subexpressions to dstCap and returns dstCap.
nil is returned if no matches are found and non-nil if matches are found.
doMatch reports whether either r, b or s match the regexp.
doOnePass implements r.doExecute using the one-pass execution engine.
( T) expand(dst []byte, template string, bsrc []byte, src string, match []int) []byte
get returns a machine to use for matching re.
It uses the re's machine cache if possible, to avoid
unnecessary allocation.
The number of capture values in the program may correspond
to fewer capturing expressions than are in the regexp.
For example, "(a){0}" turns into an empty program, so the
maximum capture in the program is 0 but we need to return
an expression for \1. Pad appends -1s to the slice a as needed.
put returns a machine to the correct machine pool.
( T) replaceAll(bsrc []byte, src string, nmatch int, repl func(dst []byte, m []int) []byte) []byte
tryBacktrack runs a backtracking search starting at pos.
*T : encoding/json.Unmarshaler
T : expvar.Var
T : fmt.Stringer
T : context.stringer
T : runtime.stringer
Package-Level Functions (total 35, in which 20 are exported)
AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no
scheme. If disableSSL is true HTTP will set HTTP instead of the default HTTPS.
If disableSSL is set, it will only set the URL's scheme if the URL does not
contain a scheme.
AwsCnPartition returns the Resolver for AWS China.
AwsIsoBPartition returns the Resolver for AWS ISOB (US).
AwsIsoPartition returns the Resolver for AWS ISO (US).
AwsPartition returns the Resolver for AWS Standard.
AwsUsGovPartition returns the Resolver for AWS GovCloud (US).
DecodeModel unmarshals a Regions and Endpoint model definition file into
a endpoint Resolver. If the file format is not supported, or an error occurs
when unmarshaling the model an error will be returned.
Casting the return value of this func to a EnumPartitions will
allow you to get a list of the partitions in the order the endpoints
will be resolved in.
resolver, err := endpoints.DecodeModel(reader)
partitions := resolver.(endpoints.EnumPartitions).Partitions()
for _, p := range partitions {
// ... inspect partitions
}
DefaultPartitions returns a list of the partitions the SDK is bundled
with. The available partitions are: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US).
partitions := endpoints.DefaultPartitions
for _, p := range partitions {
// ... inspect partitions
}
DefaultResolver returns an Endpoint resolver that will be able
to resolve endpoints for: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US).
Use DefaultPartitions() to get the list of the default partitions.
DisableSSLOption sets the DisableSSL options. Can be used as a functional
option when resolving endpoints.
GetS3UsEast1RegionalEndpoint function returns the S3UsEast1RegionalEndpointFlag based
on the input string provided in env config or shared config by the user.
`legacy`, `regional` are the only case-insensitive valid strings for
resolving the S3 regional Endpoint flag.
GetSTSRegionalEndpoint function returns the STSRegionalEndpointFlag based
on the input string provided in env config or shared config by the user.
`legacy`, `regional` are the only case-insensitive valid strings for
resolving the STS regional Endpoint flag.
NewUnknownEndpointError builds and returns UnknownEndpointError.
NewUnknownServiceError builds and returns UnknownServiceError.
PartitionForRegion returns the first partition which includes the region
passed in. This includes both known regions and regions which match
a pattern supported by the partition which may include regions that are
not explicitly known by the partition. Use the Regions method of the
returned Partition if explicit support is needed.
RegionsForService returns a map of regions for the partition and service.
If either the partition or service does not exist false will be returned
as the second parameter.
This example shows how to get the regions for DynamoDB in the AWS partition.
rs, exists := endpoints.RegionsForService(endpoints.DefaultPartitions(), endpoints.AwsPartitionID, endpoints.DynamodbServiceID)
This is equivalent to using the partition directly.
rs := endpoints.AwsPartition().Services()[endpoints.DynamodbServiceID].Regions()
ResolveUnknownServiceOption sets the ResolveUnknownService option. Can be used
as a functional option when resolving endpoints.
StrictMatchingOption sets the StrictMatching option. Can be used as a functional
option when resolving endpoints.
STSRegionalEndpointOption enables the STS endpoint resolver behavior to resolve
STS endpoint to their regional endpoint, instead of the global endpoint.
UseDualStackOption sets the UseDualStack option. Can be used as a functional
option when resolving endpoints.
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.