Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SwitchSlave ¶
func SwitchSlave(db sqlx.DBExecutor) sqlx.DBExecutor
Types ¶
type CanSlave ¶
type CanSlave interface {
UseSlave() sqlx.DBExecutor
}
type Endpoint ¶
type Endpoint struct { Master types.Endpoint Slave types.Endpoint Database *sqlx.Database `env:"-"` Retry *retry.Retry Extensions []string PoolSize int ConnMaxLifetime types.Duration *sqlx.DB `env:"-"` // contains filtered or unexported fields }
func (Endpoint) LivenessCheck ¶
func (Endpoint) NewConnection ¶ added in v1.0.0
func (e Endpoint) NewConnection() (sqlx.DBExecutor, error)
Establish a new connection in master mode with pg
func (*Endpoint) SetDefault ¶
func (e *Endpoint) SetDefault()
func (Endpoint) UseSlave ¶
func (e Endpoint) UseSlave() sqlx.DBExecutor
Click to show internal directories.
Click to hide internal directories.