Documentation
¶
Overview ¶
Package outbox builds the durable side of a transactional outbox from config: the store the relay (workflows/outbox) leases rows from and finalizes them in. Each kind is a subpackage — stub/ (no rows, the default, so a relay boots with no database) and postgres/ (a product's own outbox table) — and NewFromConfig returns the interfaces.OutboxStore behind the store tier (Decorate), as the decoration config's stores tier resolves it for Config.Name.
Index ¶
Constants ¶
const ( // KindStub is the empty outbox (the default). KindStub = client.KindStub // KindPostgres is a product's PostgreSQL outbox table. KindPostgres client.Kind = "postgres" )
Variables ¶
This section is empty.
Functions ¶
func NewFromConfig ¶
func NewFromConfig( ctx context.Context, cfg *Config, deps Deps, ) (interfaces.OutboxStore, error)
NewFromConfig builds the outbox store cfg.Kind selects, behind the store tier, with no I/O. An unknown kind, an invalid backend config, a postgres kind without a DB, or a decoration that fails to build is CodeInvalidInput. cfg must not be nil.
Types ¶
type Config ¶
type Config struct {
// Kind selects the backend; empty means KindStub.
Kind client.Kind `yaml:"kind" mapstructure:"kind"`
// Name is the store's name in the decoration config's stores tier (and its metric,
// span and log label); empty means "outbox".
Name string `yaml:"name" mapstructure:"name"`
// Postgres configures KindPostgres.
Postgres postgres.Config `yaml:"postgres" mapstructure:"postgres"`
}
Config selects and tunes the outbox store.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package postgres is the PostgreSQL kind of the outbox store (stores/outbox): the relay's claim, lease and finalize operations over a product's own outbox table, named by configuration.
|
Package postgres is the PostgreSQL kind of the outbox store (stores/outbox): the relay's claim, lease and finalize operations over a product's own outbox table, named by configuration. |
|
Package stub is the stub kind of the outbox store (stores/outbox): an outbox with no rows, so a relay graph boots and runs with no database.
|
Package stub is the stub kind of the outbox store (stores/outbox): an outbox with no rows, so a relay graph boots and runs with no database. |