app

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 17 Imported by: 0

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

View Source
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

func New

func New(ctx context.Context, cfg *config.Config, awsCfg aws.Config, opts ...Option) (*handler.Handler, error)

New builds the Lambda handler. It compiles the policies and creates every client up front, so configuration problems surface at startup.

Types

type CognitoAPI added in v1.1.0

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

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets the HTTP client used for SendGrid.

Jump to

Keyboard shortcuts

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