Documentation
¶
Overview ¶
Package postgres is the PostgreSQL engine for go-messaging's outbox and inbox.
The package exports:
- Outbox, the statements outbox.New runs, and Inbox, the statement inbox.New runs
- Migrations, the outbox's and the inbox's tables as a migration set, named Source and recorded in the history table Table
- Verify, which prepares the statements against a live schema, and Statements, which lists them
- Pending, which counts the outbox rows awaiting publication
Schema ¶
The migration set holds both the outbox's table and the inbox's, so one module ships them in one migration. Every object it creates is prefixed messaging_, and a consumer declares the set ahead of its own. An outbox row the relay quarantines stays in messaging_outbox with the time and reason of its quarantine, quarantined_at and quarantine_reason, and is neither claimed again nor counted by Pending. A released migration never changes; a golden-hash test pins each one.
Statements ¶
The statements are authored files compiled through sqlate's query package; every one that writes requires a transaction. Verify is for a consumer's verify stage, after its migrations.
The pgtest package gives each test a throwaway database, for this module's integration suite and a consumer's own.
Index ¶
Constants ¶
const ( // Source is the migration set's name and the prefix of every object the // set owns. Source = "messaging" // Table is the history table the set's migrations are recorded in, apart // from a consumer's own. Table = "messaging_schema_version" )
Variables ¶
This section is empty.
Functions ¶
func Migrations ¶
Migrations returns the messaging migration set for Postgres: the outbox's and the inbox's tables. A consumer declares it ahead of its own set in its migrator.
func Outbox ¶
Outbox returns the outbox's statements for Postgres, for outbox.New.
func Pending ¶
Pending counts the outbox rows awaiting publication, neither published nor quarantined, for a consumer that reports or monitors the outbox's lag.
func Statements ¶
Statements returns the compiled statements in name order, for a consumer that lists the SQL its program runs.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package pgtest gives each test its own throwaway Postgres database, so no test depends on the compose stack's database or on another test.
|
Package pgtest gives each test its own throwaway Postgres database, so no test depends on the compose stack's database or on another test. |