Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect(ctx context.Context, pCfg *postgresconfig5.PostgresConfig, afterConnect func(context.Context, *pgx.Conn) error, log *logger.ZapLogger, ) (conn *pgx.Conn, err error)
Connect connect to database in pgx v4
func ConnectPool ¶
func ConnectPool(ctx context.Context, pCfg *postgresconfig5.PostgresConfig, afterConnect func(context.Context, *pgx.Conn) error, log *logger.ZapLogger, ) (*pgxpool.Pool, error)
ConnectPool connect pool to postgres in pgx v4
Types ¶
type AfterConnectFunc ¶
type AfterConnectList ¶
type AfterConnectList []AfterConnectFunc
func NewAfterConnectList ¶
func NewAfterConnectList(opts ...AfterConnectFunc) AfterConnectList
func (AfterConnectList) AfterConnect ¶
func (c AfterConnectList) AfterConnect(ctx context.Context, conn *pgx.Conn) error
type DbPool ¶
type DbPool struct {
// contains filtered or unexported fields
}
DbPool dbo
func NewDbPool ¶
func NewDbPool(ctx context.Context, cfg *postgresconfig5.PostgresConfig, log *logger.ZapLogger, opts ...AfterConnectFunc) (*DbPool, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.