Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Name Name `yaml:"Name"`
Postgresql PostgresqlConfig
}
type DBManager ¶
type DBManager interface {
// Primary returns the primary database connection.
Primary() *sql.DB
// Replica returns the random replica database connection.
// eventually distribution will be equal
Replica() *sql.DB
}
func NewDBManager ¶
NewDBManager creates a new DBManager based on the provided configuration.
type DBManagerImpl ¶
type DBManagerImpl struct {
// contains filtered or unexported fields
}
func (*DBManagerImpl) Primary ¶
func (d *DBManagerImpl) Primary() *sql.DB
func (*DBManagerImpl) Replica ¶
func (d *DBManagerImpl) Replica() *sql.DB
Click to show internal directories.
Click to hide internal directories.