Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBHealthCheck ¶
func DBHealthCheck(cfg *Config, db DB, logger xlog.OptionalLogger) xhealth.CheckMapping
DBHealthCheck register a health check for the database. officially it supports only mysql, postgres and mysql. however it try to register the unknown anyways.
Types ¶
type Config ¶
type Config struct { // DriverName can be one of sqlite, mysql or postgres DriverName string `yaml:"driver"` DSN string `yaml:"dsn"` Connection ConfigConnection `yaml:"connection"` }
Config holds options to configure the database sql.DB pool of connections
func LoadConfig ¶
func LoadConfig(params LoadConfigParams) (*Config, error)
type ConfigConnection ¶
type DBQualifier ¶
func NewDB ¶
func NewDB(cfg *Config) (DBQualifier, error)
NewDB creates a sql.SB with the given config.
Click to show internal directories.
Click to hide internal directories.