Documentation
¶
Overview ¶
Package postgres wires PostgreSQL-backed repositories for configcore.
This package is intentionally outside cells/configcore's root package so the Cell's exported API stays port-oriented while composition roots can still choose the concrete storage adapter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithPool ¶
WithPool injects PostgreSQL-backed config and flag repositories into configcore using the provided pool.
clk must be non-nil; pass clock.Real() at the composition root. The pool lifecycle, schema guard, TxManager, outbox writer, and relay remain the composition root's responsibility. This option only adapts the pool into configcore's cell-local repository ports.
Returns ErrCellInvalidConfig when pool is nil so wiring mistakes fail before ConfigCore is constructed with unusable repositories.
WithLogger configures repository logs only. Call configcore.WithLogger separately when the cell itself should use the same logger.
Types ¶
type Option ¶
type Option func(*settings)
Option configures PostgreSQL repository wiring for configcore.
func WithLogger ¶
WithLogger sets the logger used by the config repository. Nil means slog.Default(), matching the repository constructor's default.
func WithOnStaleCipher ¶
WithOnStaleCipher sets the callback invoked when a stale encrypted value is read. Composition roots commonly use this to increment an observability counter without exposing Prometheus types through cells/configcore.
func WithValueTransformer ¶
func WithValueTransformer(t kcrypto.ValueTransformer) Option
WithValueTransformer sets the transformer used by the config repository to encrypt/decrypt sensitive values at the repository boundary.