Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SwitchSlave ¶
func SwitchSlave(executor sqlx.DBExecutor) sqlx.DBExecutor
Types ¶
type CanSlave ¶
type CanSlave interface {
UseSlave() sqlx.DBExecutor
}
type Postgres ¶
type Postgres struct {
Host string `env:",upstream"`
SlaveHost string `env:",upstream"`
Port int
User string `env:""`
Password envconfig.Password `env:""`
Extra string
Extensions []string
PoolSize int
ConnMaxLifetime envconfig.Duration
Database *sqlx.Database `env:"-"`
*sqlx.DB `env:"-"`
// contains filtered or unexported fields
}
func (*Postgres) LivenessCheck ¶
func (*Postgres) SetDefaults ¶
func (m *Postgres) SetDefaults()
func (*Postgres) UseSlave ¶
func (m *Postgres) UseSlave() sqlx.DBExecutor
type PostgresEndpoint ¶
type PostgresEndpoint struct {
Endpoint envconfig.Endpoint `env:""`
Database *sqlx.Database `env:"-"`
Extensions []string
PoolSize int
ConnMaxLifetime envconfig.Duration
*sqlx.DB `env:"-"`
}
func (*PostgresEndpoint) Init ¶
func (m *PostgresEndpoint) Init()
func (*PostgresEndpoint) LivenessCheck ¶
func (m *PostgresEndpoint) LivenessCheck() map[string]string
func (*PostgresEndpoint) SetDefaults ¶
func (m *PostgresEndpoint) SetDefaults()
Click to show internal directories.
Click to hide internal directories.