Documentation
¶
Overview ¶
Package persistence wires the database connector, migrator, and unit of work shared by all Tupic services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(connector.New, migrator.New, uow.New), fx.Invoke(registerLifecycle), )
Module provides the connector (with *gorm.DB), migrator, and unit of work. It requires a persistence.Config in the graph, supplied by the service.
Functions ¶
This section is empty.
Types ¶
type PostgresConfig ¶
type PostgresConfig = config.PostgresConfig
PostgresConfig holds PostgreSQL connection settings.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package config holds the persistence configuration types in a leaf package so the connector and migrator can import them without cycles.
|
Package config holds the persistence configuration types in a leaf package so the connector and migrator can import them without cycles. |
|
Package connector opens and supervises the SQL connection pool and its GORM handle.
|
Package connector opens and supervises the SQL connection pool and its GORM handle. |
|
Package migrator selects the migration driver from configuration.
|
Package migrator selects the migration driver from configuration. |
|
contract
Package contract defines the migration driver contract.
|
Package contract defines the migration driver contract. |
|
postgres
Package postgres implements the migration contract with golang-migrate.
|
Package postgres implements the migration contract with golang-migrate. |
|
Package uow provides the UnitOfWork contract and its GORM transaction implementation, plus the context plumbing repositories use to join an ambient transaction.
|
Package uow provides the UnitOfWork contract and its GORM transaction implementation, plus the context plumbing repositories use to join an ambient transaction. |
Click to show internal directories.
Click to hide internal directories.