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 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.
Click to show internal directories.
Click to hide internal directories.