pgxutils

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PgxMaxConnect = 5
)

Variables

This section is empty.

Functions

func AfterConnectMap

func AfterConnectMap(conn *pgx.Conn) error

func NewPgxPool

func NewPgxPool(config *PostgresConfig) (*pgx.ConnPool, error)

func NewPgxPoolAfterConnect

func NewPgxPoolAfterConnect(config *PostgresConfig, afterConnectMap func(*pgx.Conn) error, debug bool) (*pgx.ConnPool, error)

func NewPgxPoolAfterConnectZap

func NewPgxPoolAfterConnectZap(config *PostgresZapConfig, afterConnectMap func(*pgx.Conn) error, debug bool) (*pgx.ConnPool, error)

Types

type PostgresConfig

type PostgresConfig struct {
	User     string     `json:"User"`
	Password string     `json:"Password"`
	Database string     `json:"Database"`
	Port     int        `json:"Port"`
	Host     string     `json:"Host"`
	Logger   pgx.Logger `json:"-"`
}

func (*PostgresConfig) SetLogger

func (postgresConfig *PostgresConfig) SetLogger(logger zerolog.Logger)

func (*PostgresConfig) SetZapLogger added in v0.2.2

func (postgresConfig *PostgresConfig) SetZapLogger(logger *zap.Logger)

type PostgresZapConfig

type PostgresZapConfig struct {
	User     string             `json:"User"`
	Password string             `json:"Password"`
	Database string             `json:"Database"`
	Port     int                `json:"Port"`
	Host     string             `json:"Host"`
	Logger   *zapadapter.Logger `json:"-"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL