aws

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAccessKeyID     = ""
	DefaultSecretAccessKey = ""
	DefaultToken           = ""
)

Variables

This section is empty.

Functions

func AttemptLoggerInitMiddleware

func AttemptLoggerInitMiddleware(logger log.Logger, backoff *exec.BackoffSettings) smithyMiddleware.InitializeMiddleware

func AttemptLoggerRetryMiddleware

func AttemptLoggerRetryMiddleware(logger log.Logger) smithyMiddleware.FinalizeMiddleware

func DefaultClientConfig

func DefaultClientConfig(ctx context.Context, config cfg.Config, logger log.Logger, clientConfig ClientConfigAware) (aws.Config, error)

func DefaultClientOptions

func DefaultClientOptions(ctx context.Context, _ cfg.Config, logger log.Logger, clientConfig ClientConfigAware) ([]func(options *awsCfg.LoadOptions) error, error)

func DefaultClientRetryOptions

func DefaultClientRetryOptions(clientConfig ClientConfigAware) []func(*retry.StandardOptions)

func GetAssumeRoleCredentialsProvider

func GetAssumeRoleCredentialsProvider(ctx context.Context, roleArn string) (aws.CredentialsProvider, error)

func GetClientConfigKey

func GetClientConfigKey(service string, name string) string

func GetCredentialsOption added in v0.26.0

func GetCredentialsOption(ctx context.Context, settings ClientSettings) (func(options *awsCfg.LoadOptions) error, error)

func GetCredentialsProvider

func GetCredentialsProvider(ctx context.Context, settings ClientSettings) (aws.CredentialsProvider, error)

func GetDefaultProvider added in v0.18.3

func GetDefaultProvider() aws.CredentialsProvider

func IsAwsErrorCodeRequestCanceled

func IsAwsErrorCodeRequestCanceled(err error) bool

func LogNewClientCreated added in v0.11.2

func LogNewClientCreated(ctx context.Context, logger log.Logger, service string, clientName string, settings ClientSettings)

func NilIfEmpty added in v0.26.0

func NilIfEmpty[T comparable](val T) *T

func RetryWithBackoff

func RetryWithBackoff(backoff retry.BackoffDelayer) func(*retry.StandardOptions)

func RetryWithMaxAttempts

func RetryWithMaxAttempts(maxAttempts int) func(*retry.StandardOptions)

func RetryWithMaxBackoff

func RetryWithMaxBackoff(maxBackoff time.Duration) func(*retry.StandardOptions)

func RetryWithRateLimiter

func RetryWithRateLimiter(rateLimiter retry.RateLimiter) func(options *retry.StandardOptions)

func RetryWithRetryables

func RetryWithRetryables(retryables []retry.IsErrorRetryable) func(options *retry.StandardOptions)

func UnmarshalClientSettings

func UnmarshalClientSettings(config cfg.Config, settings ClientSettingsAware, service string, name string)

func WithResourceTarget added in v0.14.0

func WithResourceTarget(ctx context.Context, target string) context.Context

Types

type BackoffDelayer

type BackoffDelayer struct {
	// contains filtered or unexported fields
}

func NewBackoffDelayer

func NewBackoffDelayer(initialInterval time.Duration, maxInterval time.Duration) *BackoffDelayer

func (*BackoffDelayer) BackoffDelay

func (d *BackoffDelayer) BackoffDelay(attempt int, _ error) (time.Duration, error)

type ClientConfigAware

type ClientConfigAware interface {
	GetSettings() ClientSettings
	GetLoadOptions() []func(options *awsCfg.LoadOptions) error
	GetRetryOptions() []func(*retry.StandardOptions)
}

type ClientHttpSettings

type ClientHttpSettings struct {
	Timeout time.Duration `cfg:"timeout" default:"0"`
}

type ClientSettings

type ClientSettings struct {
	Region      string             `cfg:"region" default:"eu-central-1"`
	Endpoint    string             `cfg:"endpoint" default:"http://localhost:4566"`
	AssumeRole  string             `cfg:"assume_role"`
	Profile     string             `cfg:"profile"`
	Credentials Credentials        `cfg:"credentials"`
	HttpClient  ClientHttpSettings `cfg:"http_client"`
	Backoff     exec.BackoffSettings
}

func (*ClientSettings) LogFields added in v0.11.2

func (s *ClientSettings) LogFields() log.Fields

func (*ClientSettings) SetBackoff

func (s *ClientSettings) SetBackoff(backoff exec.BackoffSettings)

type ClientSettingsAware

type ClientSettingsAware interface {
	SetBackoff(backoff exec.BackoffSettings)
}

type Credentials

type Credentials struct {
	AccessKeyID     string `cfg:"access_key_id"`
	SecretAccessKey string `cfg:"secret_access_key"`
	SessionToken    string `cfg:"session_token"`
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(base log.Logger) *Logger

func (Logger) Logf

func (l Logger) Logf(classification logging.Classification, format string, v ...any)

func (Logger) WithContext

func (l Logger) WithContext(ctx context.Context) logging.Logger

type NopRateLimiter

type NopRateLimiter struct{}

func NewNopRateLimiter

func NewNopRateLimiter() NopRateLimiter

func (NopRateLimiter) AddTokens

func (n NopRateLimiter) AddTokens(_ uint) error

func (NopRateLimiter) GetToken

func (n NopRateLimiter) GetToken(_ context.Context, _ uint) (releaseToken func() error, err error)

type RetryOnClosedNetworkConnection added in v0.28.2

type RetryOnClosedNetworkConnection struct{}

func (RetryOnClosedNetworkConnection) IsErrorRetryable added in v0.28.2

func (r RetryOnClosedNetworkConnection) IsErrorRetryable(err error) aws.Ternary

Jump to

Keyboard shortcuts

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