Documentation
¶
Index ¶
- type BeforeConnectHook
- type CloseHook
- type Connector
- func (c *Connector) Close() error
- func (c *Connector) Config() (*pgxpool.Config, error)
- func (c *Connector) Connect(ctx context.Context, cfg *pgxpool.Config) (*pgxpool.Pool, error)
- func (c *Connector) ConnectToServicePool(ctx context.Context, env *Environment, cfg *pgxpool.Config) (*pgxpool.Pool, error)
- type ConnectorOption
- func WithBeforeConnectHook(hook BeforeConnectHook) ConnectorOption
- func WithCloseHook(hook CloseHook) ConnectorOption
- func WithDatabase(databaseName string) ConnectorOption
- func WithHost(host string) ConnectorOption
- func WithPassword(password string) ConnectorOption
- func WithPort(port uint16) ConnectorOption
- func WithSchema(schema string) ConnectorOption
- func WithTLSConfig(tlsConfig *tls.Config) ConnectorOption
- func WithUser(user string) ConnectorOption
- type Environment
- type EnvironmentOption
- type Pool
- type ReuseStrategy
- type ReuseStrategyCreateNewDB
- type ReuseStrategyCreateNewSchema
- type StdlibEnvironment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeforeConnectHook ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
func NewConnector(opts ...ConnectorOption) *Connector
type ConnectorOption ¶
type ConnectorOption func(*Connector)
func WithBeforeConnectHook ¶
func WithBeforeConnectHook(hook BeforeConnectHook) ConnectorOption
func WithCloseHook ¶
func WithCloseHook(hook CloseHook) ConnectorOption
func WithDatabase ¶
func WithDatabase(databaseName string) ConnectorOption
func WithHost ¶
func WithHost(host string) ConnectorOption
func WithPassword ¶
func WithPassword(password string) ConnectorOption
func WithPort ¶
func WithPort(port uint16) ConnectorOption
func WithSchema ¶
func WithSchema(schema string) ConnectorOption
func WithTLSConfig ¶
func WithTLSConfig(tlsConfig *tls.Config) ConnectorOption
func WithUser ¶
func WithUser(user string) ConnectorOption
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...EnvironmentOption) *Environment
type EnvironmentOption ¶
type EnvironmentOption func(*Environment)
func WithMaxConnsPerConnect ¶
func WithMaxConnsPerConnect(maxConnPerConnect int32) EnvironmentOption
func WithReuseStrategy ¶
func WithReuseStrategy(strategy ReuseStrategy) EnvironmentOption
type ReuseStrategy ¶
type ReuseStrategy interface {
// contains filtered or unexported methods
}
type ReuseStrategyCreateNewDB ¶
type ReuseStrategyCreateNewDB struct {
NewDBName func() string
}
type StdlibEnvironment ¶
type StdlibEnvironment struct {
// contains filtered or unexported fields
}
func NewStdlib ¶
func NewStdlib( env *Environment, opts ...stdlib.OptionOpenDB, ) *StdlibEnvironment
Click to show internal directories.
Click to hide internal directories.