Versions in this module Expand all Collapse all v0 v0.0.2 Jan 12, 2023 Changes in this version + var BuildDate string + var BuildVersion string + var CommitHash string + var GoVersion string type Pool + func (p *Pool) Collector(destHost, destDB string) *poolCollector v0.0.1 Dec 14, 2022 Changes in this version + const StatusError + const StatusIdle + const StatusInTx + const StatusUnset + var ErrCancelComplete = errors.New("cancel complete") + var ErrConnExpired = errors.New("connection expired") + var ErrPoolClosed = errors.New("pool is closed") + type AuthRow struct + type ClientConn struct + func NewClientConn(handle *pgproto3.Backend, logger *log.Logger, pool *Pool, schema string) *ClientConn + func (cc *ClientConn) CancelServerConn() error + type Conner interface + CancelRequest func(ctx context.Context) error + CheckConn func() error + Close func(ctx context.Context) error + Conn func() net.Conn + Exec func(ctx context.Context, sql string) *pgconn.MultiResultReader + type DBStats struct + Idle int + InUse int + MaxIdleClosed int64 + MaxIdleTimeClosed int64 + MaxLifetimeClosed int64 + MaxOpenConnections int + OpenConnections int + WaitCount int64 + WaitDuration time.Duration + type Pool struct + func NewPool(cfg PoolConfig) (*Pool, error) + func (p *Pool) AcquireConn() (*ServerConn, error) + func (p *Pool) Close() error + func (p *Pool) ReleaseConn(sc *ServerConn) + func (p *Pool) Reload(new PoolConfig) + func (p *Pool) SetConnMaxIdleTime(d time.Duration) + func (p *Pool) SetConnMaxLifetime(d time.Duration) + func (p *Pool) SetMaxIdleConns(n int) + func (p *Pool) SetMaxOpenConns(n int) + func (p *Pool) Stats() DBStats + type PoolConfig struct + ConnCloseTimeout time.Duration + ConnCreateTimeout time.Duration + Logger *log.Logger + MaxIdle int + MaxIdleTime time.Duration + MaxLifetime time.Duration + MaxOpen int + SchemaExecTimeout time.Duration + SpawnConn func(ctx context.Context) (Conner, error) + type PoolManager struct + func NewPoolManager(cfg config.Config, logger *log.Logger) (*PoolManager, error) + func (pm *PoolManager) Close() error + func (pm *PoolManager) GetOrCreatePool(row AuthRow) (pool *Pool, err error) + func (pm *PoolManager) Reload(cfg config.Config) + type Server struct + func New(cfg config.Config) (*Server, error) + func (s *Server) AcceptConns() error + func (s *Server) Reload(cfg config.Config) + func (s *Server) Stop() + type ServerConn struct + func (sc *ServerConn) CancelRequest(ctx context.Context) error + func (sc *ServerConn) CheckConn() error + func (sc *ServerConn) Close() error + func (sc *ServerConn) Conn() net.Conn + func (sc *ServerConn) Exec(sql string) error