Documentation ¶
Index ¶
- Constants
- func AttemptLoggerInitMiddleware(logger log.Logger, backoff *exec.BackoffSettings) smithyMiddleware.InitializeMiddleware
- func AttemptLoggerRetryMiddleware(logger log.Logger) smithyMiddleware.FinalizeMiddleware
- func CheckConnectionError(_ interface{}, err error) exec.ErrorType
- func CheckErrorRetryable(_ interface{}, err error) exec.ErrorType
- func CheckErrorThrottle(_ interface{}, err error) exec.ErrorType
- func CheckInvalidStatusError(_ interface{}, err error) exec.ErrorType
- func DefaultClientConfig(ctx context.Context, config cfg.Config, logger log.Logger, ...) (aws.Config, error)
- func DefaultClientOptions(ctx context.Context, _ cfg.Config, logger log.Logger, ...) ([]func(options *awsCfg.LoadOptions) error, error)
- func DefaultClientRetryOptions(clientConfig ClientConfigAware) []func(*retry.StandardOptions)
- func GetAssumeRoleCredentialsProvider(ctx context.Context, roleArn string) (aws.CredentialsProvider, error)
- func GetClientConfigKey(service string, name string) string
- func GetCredentialsOption(ctx context.Context, settings ClientSettings) (func(options *awsCfg.LoadOptions) error, error)
- func GetCredentialsProvider(ctx context.Context, settings ClientSettings) (aws.CredentialsProvider, error)
- func GetDefaultCredentials() *credentials.Credentials
- func GetDefaultProvider() aws.CredentialsProvider
- func IsAwsError(err error, awsCode string) bool
- func IsAwsErrorCodeRequestCanceled(err error) bool
- func IsConnectionError(err error) bool
- func IsInvalidStatusError(err error) bool
- func LogNewClientCreated(ctx context.Context, logger log.Logger, service string, clientName string, ...)
- func NilIfEmpty[T comparable](val T) *T
- func RetryWithBackoff(backoff retry.BackoffDelayer) func(*retry.StandardOptions)
- func RetryWithMaxAttempts(maxAttempts int) func(*retry.StandardOptions)
- func RetryWithMaxBackoff(maxBackoff time.Duration) func(*retry.StandardOptions)
- func RetryWithRateLimiter(rateLimiter retry.RateLimiter) func(options *retry.StandardOptions)
- func RetryWithRetryables(retryables []retry.IsErrorRetryable) func(options *retry.StandardOptions)
- func UnmarshalClientSettings(config cfg.Config, settings ClientSettingsAware, service string, name string)
- func WithResourceTarget(ctx context.Context, target string) context.Context
- type BackoffDelayer
- type BackoffExecutor
- type ClientConfigAware
- type ClientHttpSettings
- type ClientSettings
- type ClientSettingsAware
- type Credentials
- type DefaultExecutor
- type Executor
- type InvalidStatusError
- type Logger
- type NopRateLimiter
- type RequestFunction
- type Sender
- type TestExecution
- type TestableExecutor
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 CheckConnectionError ¶
func CheckErrorRetryable ¶
func CheckErrorThrottle ¶
func CheckInvalidStatusError ¶
func DefaultClientConfig ¶
func DefaultClientOptions ¶
func DefaultClientRetryOptions ¶
func DefaultClientRetryOptions(clientConfig ClientConfigAware) []func(*retry.StandardOptions)
func GetClientConfigKey ¶
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 GetDefaultCredentials ¶
func GetDefaultCredentials() *credentials.Credentials
GetDefaultCredentials provides you with credentials to use. In an integration test, you will get the credentials matching your environment or some static credentials if there are no credentials in your environment. Outside of tests, you get this implementation that tells the AWS SDK to use the default credentials (as if you didn't specify any credentials at all).
func GetDefaultProvider ¶ added in v0.18.3
func GetDefaultProvider() aws.CredentialsProvider
func IsAwsError ¶
func IsConnectionError ¶
func IsInvalidStatusError ¶
func LogNewClientCreated ¶ added in v0.11.2
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)
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 ¶
type BackoffExecutor ¶
type BackoffExecutor struct {
// contains filtered or unexported fields
}
func (BackoffExecutor) Execute ¶
func (b BackoffExecutor) Execute(ctx context.Context, f RequestFunction) (interface{}, error)
type ClientConfigAware ¶
type ClientConfigAware interface { GetSettings() ClientSettings GetLoadOptions() []func(options *awsCfg.LoadOptions) error GetRetryOptions() []func(*retry.StandardOptions) }
type ClientHttpSettings ¶
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 DefaultExecutor ¶
type DefaultExecutor struct{}
func (DefaultExecutor) Execute ¶
func (e DefaultExecutor) Execute(ctx context.Context, f RequestFunction) (interface{}, error)
type Executor ¶
type Executor interface {
Execute(ctx context.Context, f RequestFunction) (interface{}, error)
}
func NewBackoffExecutor ¶
func NewBackoffExecutor(logger log.Logger, res *exec.ExecutableResource, settings *exec.BackoffSettings, checks ...exec.ErrorChecker) Executor
func NewBackoffExecutorWithSender ¶
func NewBackoffExecutorWithSender(logger log.Logger, res *exec.ExecutableResource, settings *exec.BackoffSettings, sender Sender, checks ...exec.ErrorChecker) Executor
func NewExecutor ¶
func NewExecutor(logger log.Logger, res *exec.ExecutableResource, settings *exec.BackoffSettings, checks ...exec.ErrorChecker) Executor
type InvalidStatusError ¶
type InvalidStatusError struct {
Status int
}
func (*InvalidStatusError) As ¶
func (e *InvalidStatusError) As(target interface{}) bool
func (*InvalidStatusError) Error ¶
func (e *InvalidStatusError) Error() string
func (*InvalidStatusError) Is ¶
func (e *InvalidStatusError) Is(err error) bool
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type NopRateLimiter ¶
type NopRateLimiter struct{}
func NewNopRateLimiter ¶
func NewNopRateLimiter() NopRateLimiter
func (NopRateLimiter) AddTokens ¶
func (n NopRateLimiter) AddTokens(_ uint) error
type RequestFunction ¶
type TestExecution ¶
type TestExecution struct { Output interface{} Err error }
type TestableExecutor ¶
type TestableExecutor struct {
// contains filtered or unexported fields
}
func NewTestableExecutor ¶
func NewTestableExecutor(clientMock *mock.Mock, executions ...TestExecution) *TestableExecutor
func (*TestableExecutor) AssertExpectations ¶
func (e *TestableExecutor) AssertExpectations(t *testing.T)
func (*TestableExecutor) Execute ¶
func (e *TestableExecutor) Execute(_ context.Context, f RequestFunction) (interface{}, error)
func (*TestableExecutor) ExpectExecution ¶
func (e *TestableExecutor) ExpectExecution(clientMethod string, input interface{}, output interface{}, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.