Documentation
¶
Overview ¶
Package app wires the function together from its configuration. It is the only package that knows about every other one; main and the devtool CLI call it, and tests use its options to replace the Cognito, DynamoDB, and HTTP clients.
Index ¶
Constants ¶
const ( MaxAttempts = 2 MaxBackoff = 200 * time.Millisecond )
AWS SDK retries. Cognito waits at most 5 seconds for the function, and the SDK's default (3 attempts, up to 20 seconds apart) would outlast it, so each call is retried at most once, soon after the first attempt. Under sustained throttling more retries would only add load.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CognitoAPI ¶ added in v1.1.0
type CognitoAPI interface {
postconfirmation.CognitoAPI
preauthentication.CognitoAPI
}
CognitoAPI is the part of the Cognito API the hooks call.
type Option ¶
type Option func(*deps)
Option replaces a dependency that New would otherwise build from the configuration and AWS config.
func WithCognitoClient ¶
func WithCognitoClient(c CognitoAPI) Option
WithCognitoClient replaces the Cognito client the PostConfirmation and PreAuthentication hooks call.
func WithDynamoDBClient ¶ added in v1.1.0
func WithDynamoDBClient(c rotation.DynamoDBAPI) Option
WithDynamoDBClient replaces the DynamoDB client that reads and writes rotation records.
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client used for SendGrid.