Documentation
¶
Index ¶
Constants ¶
View Source
const ( DriverPostgres = "postgres" DriverMySQL = "mysql" DriverSQLite = "sqlite" )
Variables ¶
View Source
var (
ErrUnknownDriver = errors.New("unknown driver")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.19.2
type Config struct {
Driver string `mapstructure:"dbDriver" envVar:"ATMK_DB_DRIVER"`
Host string `mapstructure:"dbHost" envVar:"ATMK_DB_HOST"`
Port string `mapstructure:"dbPort" envVar:"ATMK_DB_PORT"`
User string `mapstructure:"dbUser" envVar:"ATMK_DB_USER"`
Pass string `mapstructure:"dbPass" envVar:"ATMK_DB_PASS"`
Name string `mapstructure:"dbName" envVar:"ATMK_DB_NAME"`
Schema string `mapstructure:"dbSchema" envVar:"ATMK_DB_SCHEMA"`
SSL bool `mapstructure:"dbSSL" envVar:"ATMK_DB_SSL"`
PingTimeout int `mapstructure:"dbPingTimeout" envVar:"ATMK_DB_TIMEOUT"`
}
type PostgresDB ¶ added in v0.19.2
type PostgresDB struct {
// contains filtered or unexported fields
}
func (*PostgresDB) Connect ¶ added in v0.19.2
func (postgresDB *PostgresDB) Connect() (*sql.DB, error)
func (*PostgresDB) Ping ¶ added in v0.19.2
func (postgresDB *PostgresDB) Ping() error
Click to show internal directories.
Click to hide internal directories.