lambdastorage

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package lambdastorage provides explicit product-level storage bootstrap for Lambda handlers that need TableTheory DB clients and repository storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Config    *config.Config
	Logger    *zap.Logger
	DB        dynamormcore.DB
	Repos     storagecore.RepositoryStorage
	TableName string
}

Dependencies are the typed storage dependencies produced by Initialize.

func Initialize

func Initialize(ctx context.Context, lambdaCtx *common.LambdaContext, opts Options) (*Dependencies, error)

Initialize ensures a LambdaContext has typed storage dependencies and writes them back to LambdaContext for compatibility with existing handlers.

type NewDBFunc

type NewDBFunc func(context.Context, string) (dynamormcore.DB, error)

NewDBFunc creates a Lambda-optimized TableTheory database client.

type NewRepositoryStorageFunc

type NewRepositoryStorageFunc func(dynamormcore.DB, string, *zap.Logger) (storagecore.RepositoryStorage, error)

NewRepositoryStorageFunc creates repository storage over a TableTheory DB.

type Options

type Options struct {
	// ServiceName is used in validation errors to make cold-start failures
	// operator-readable without relying on ad-hoc processor text.
	ServiceName string

	// TableName overrides Config.DynamoTableName when a Lambda stores data in a
	// non-main table. Empty uses Config.DynamoTableName.
	TableName string

	// RequireRepositories initializes and validates RepositoryStorage in addition
	// to the TableTheory DB client.
	RequireRepositories bool

	// AllowEmptyRegion permits custom NewDB hooks that deliberately resolve AWS
	// region from their own environment/config path.
	AllowEmptyRegion bool

	// NewDB and NewRepositoryStorage are injectable for tests. Production callers
	// should leave them nil unless they already expose package-local hooks.
	NewDB                NewDBFunc
	NewRepositoryStorage NewRepositoryStorageFunc
}

Options controls explicit Lambda storage bootstrap.

Jump to

Keyboard shortcuts

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