Documentation
¶
Overview ¶
Package stdpgxfx provides postgres pgx package as fx dependencies.
Index ¶
- func NewPoolConfig(cfg Config, logs *zap.Logger) (*pgxpool.Config, error)
- func Provide(derivedPoolNames ...string) fx.Option
- func ProvideDeriver(name string, deriver Deriver) fx.Option
- func SnapshotProvide(filename string) fx.Option
- func TestProvide(tb testing.TB, derivedPoolNames ...string) fx.Option
- type Config
- type Deriver
- type Params
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPoolConfig ¶
NewPoolConfig inits a pool configuration from the package config.
func ProvideDeriver ¶ added in v0.0.13
ProvideDeriver is a short-hande function for providing a named deriver function that.
func SnapshotProvide ¶
SnapshotProvide provides a snapshot migrater.
Types ¶
type Config ¶
type Config struct { // RWDatabaseURL configures the database connection string for the read-write connection. RWDatabaseURL string `env:"RW_DATABASE_URL"` // PoolConnectionTimeout configures how long the pgx pool connect logic waits for the connection to establish PoolConnectionTimeout time.Duration `env:"POOL_CONNECTION_TIMEOUT" envDefault:"5s"` // PoolCloseTimeout is the time we'll allow to to close the connection pool. Only effective if shorter than // the fx shutdown timeout PoolCloseTimeout time.Duration `env:"POOL_CLOSE_TIMEOUT" envDefault:"5s"` }
Config configures the components.
type Deriver ¶ added in v0.0.13
Deriver needs to be provided by the user of this module if derived pools are created.
Click to show internal directories.
Click to hide internal directories.