Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Database struct { Host string Port string DB string `validate:"required"` User string Password string Driver string `validate:"required"` SSL string `default:"disable"` } User string Pswd string Host string Port string DBName string Driver string Limit int `fig:"limit" default:"100"` }
Config struct is used to store the db connection data.
func Get ¶
func Get() *Config
Get returns a config object with the db connection data already in place.
func New ¶ added in v0.13.0
New returns a config instance the with db connection data inplace based on the flags of a cobra command.
func (*Config) GetDBConnStr ¶
GetDBConnStr returns the connection string.
func (*Config) GetSQLXDBConnStr ¶ added in v0.2.0
GetSQLXDBConnStr returns the connection string.
func (*Config) MigrateInstance ¶ added in v0.13.0
MigrateInstance returns a migrate instance based on the given driver.
Click to show internal directories.
Click to hide internal directories.