Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrPemParse when couldn't parse pem in sslrootcert ErrPemParse = Error("couldn't parse pem in sslrootcert") // ErrEmptyConfig when given empty options ErrEmptyConfig = Error("database empty config") // ErrEmptyLogger when logger not initialized ErrEmptyLogger = Error("database empty logger") // ErrSSLKeyHasWorldPermissions when pk permissions no u=rw (0600) or less ErrSSLKeyHasWorldPermissions = Error("private key file has group or world access. Permissions should be u=rw (0600) or less") )
Variables ¶
View Source
var ( // Module is default connection to PostgreSQL Module = module.Module{ {Constructor: NewDefaultConfig}, {Constructor: NewConnection}, } )
Functions ¶
Types ¶
type Config ¶
type Config struct { Hostname string Username string Password string Database string Debug bool PoolSize int Logger *zap.Logger Options map[string]string }
Config alias
type Hook ¶
type Hook struct { StartAt time.Time Before func(*pg.QueryEvent) After func(*pg.QueryEvent) }
Hook is a simple implementation of pg.QueryHook
Click to show internal directories.
Click to hide internal directories.