Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresConfig ¶
type PostgresConfig struct { Host string Port string User string Password string Database string SSLMode string }
PostgresConfig contains config for postgres connection
func (PostgresConfig) String ¶
func (pgcfg PostgresConfig) String() string
type PostgresDB ¶
PostgresDB is a sql.DB with reconnect functionality.
func (*PostgresDB) Connect ¶
func (db *PostgresDB) Connect() error
Connect checks database connection and connects if not connected.
func (*PostgresDB) Name ¶ added in v0.0.5
func (db *PostgresDB) Name() string
func (*PostgresDB) RetryableError ¶ added in v0.0.5
func (db *PostgresDB) RetryableError(err error) bool
RetryableError determines if a transaction should be retried after failing due to the specified error. When true, sleeps for a short random time before returning.
func (*PostgresDB) SqlDB ¶
func (db *PostgresDB) SqlDB() *sql.DB
Click to show internal directories.
Click to hide internal directories.