Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Database []Database User string Pswd string Host string Port string DBName string Driver string Limit uint `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.
type Database ¶ added in v0.18.0
type Database struct { Name string Host string Port string DB string `validate:"required"` User string Password string Driver string `validate:"required"` Schema string // SSL connection params. SSL string `default:"disable"` SSLCert string `fig:"sslcert"` SSLKey string `fig:"sslkey"` SSLPassword string `fig:"sslpassword"` SSLRootcert string `fig:"sslrootcert"` }
Click to show internal directories.
Click to hide internal directories.