Documentation ¶
Overview ¶
Package awsopt provides functions to configure common AWS options for the official aws-sdk-go-v2 library.
These common options can be easily used with other AWS-based packages in this library, such as s3 and sqs.
Index ¶
- type Options
- func (c *Options) LoadDefaultConfig(ctx context.Context) (aws.Config, error)
- func (c *Options) WithAWSOption(opt config.LoadOptionsFunc)
- func (c *Options) WithEndpoint(url string, isImmutable bool)
- func (c *Options) WithRegion(region string)
- func (c *Options) WithRegionFromURL(url, defaultRegion string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options []config.LoadOptionsFunc
Options is a set of all AWS options to apply.
func (*Options) LoadDefaultConfig ¶
LoadDefaultConfig populates an AWS Config with the values from the external configurations and set options.
func (*Options) WithAWSOption ¶
func (c *Options) WithAWSOption(opt config.LoadOptionsFunc)
WithAWSOption allows to add an arbitrary AWS option.
func (*Options) WithEndpoint ¶
WithEndpoint overrides the AWS endpoint for the service.
func (*Options) WithRegion ¶
WithRegion allows to specify the AWS region.
func (*Options) WithRegionFromURL ¶
WithRegionFromURL allows to specify the AWS region extracted from the provided URL. If the URL does not contain a region, a default one will be returned with the order of precedence:
- the specified defaultRegion;
- the AWS_REGION environment variable;
- the AWS_DEFAULT_REGION environment variable;
- the region set in the awsDefaultRegion constant.