aws

package
Version: v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package aws provides fundamental Wire providers for Amazon Web Services (AWS).

Index

Constants

This section is empty.

Variables

DefaultSession is a Wire provider set that provides a *session.Session using the default options.

Functions

func ConfigCredentials

func ConfigCredentials(cfg *aws.Config) *credentials.Credentials

ConfigCredentials returns cfg.Credentials.

func ConfigFromURLParams added in v0.12.0

func ConfigFromURLParams(q url.Values) (*aws.Config, error)

ConfigFromURLParams returns an aws.Config initialized based on the URL parameters in q. It is intended to be used by URLOpeners for AWS services. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

It returns an error if q contains any unknown query parameters; callers should remove any query parameters they know about from q before calling ConfigFromURLParams.

The following query options are supported:

- region: The AWS region for requests; sets aws.Config.Region.
- endpoint: The endpoint URL (hostname only or fully qualified URI); sets aws.Config.Endpoint.
- disableSSL: A value of "true" disables SSL when sending requests; sets aws.Config.DisableSSL.
- s3ForcePathStyle: A value of "true" forces the request to use path-style addressing; sets aws.Config.S3ForcePathStyle.

func NewDefaultSession added in v0.14.0

func NewDefaultSession() (*session.Session, error)

NewDefaultSession returns a *session.Session using the default options.

func NewDefaultV2Config added in v0.24.0

func NewDefaultV2Config(ctx context.Context) (awsv2.Config, error)

NewDefaultV2Config returns a aws.Config for AWS SDK v2, using the default options.

func NewSessionFromURLParams added in v0.24.0

func NewSessionFromURLParams(q url.Values) (*session.Session, url.Values, error)

NewSessionFromURLParams returns an session.Session with session.Options initialized based on the URL parameters in q. It is intended to be used by URLOpeners for AWS services. https://docs.aws.amazon.com/sdk-for-go/api/aws/session/#Session

It should be used before ConfigFromURLParams as it strips the query parameters it knows about

The following query options are supported:

- profile: The AWS profile to use from the AWS configs (shared config file and
           shared credentials file)

func SessionConfig

func SessionConfig(sess *session.Session) *aws.Config

SessionConfig returns sess.Config.

func UseV2 added in v0.24.0

func UseV2(q url.Values) bool

UseV2 returns true iff the URL parameters indicate that the provider should use the AWS SDK v2.

"awssdk=v1" will force V1. "asssdk=v2" will force V2. No "awssdk" parameter (or any other value) will return the default, currently V1. Note that the default may change in the future.

func V2ConfigFromURLParams added in v0.24.0

func V2ConfigFromURLParams(ctx context.Context, q url.Values) (awsv2.Config, error)

V2ConfigFromURLParams returns an aws.Config for AWS SDK v2 initialized based on the URL parameters in q. It is intended to be used by URLOpeners for AWS services if UseV2 returns true.

https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config

It returns an error if q contains any unknown query parameters; callers should remove any query parameters they know about from q before calling V2ConfigFromURLParams.

The following query options are supported:

- region: The AWS region for requests; sets WithRegion.
- profile: The shared config profile to use; sets SharedConfigProfile.

Types

type ConfigOverrider added in v0.11.0

type ConfigOverrider struct {
	Base    client.ConfigProvider
	Configs []*aws.Config
}

ConfigOverrider implements client.ConfigProvider by overlaying a list of configurations over a base configuration provider.

func (ConfigOverrider) ClientConfig added in v0.11.0

func (co ConfigOverrider) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config

ClientConfig calls the base provider's ClientConfig method with co.Configs followed by the arguments given to ClientConfig.

Source Files

Directories

Path Synopsis
Package awscloud contains Wire providers for AWS services.
Package awscloud contains Wire providers for AWS services.
Package rds contains Wire providers that are common across RDS.
Package rds contains Wire providers that are common across RDS.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL