Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` Database string `mapstructure:"database"` Pool int `mapstructure:"pool"` Timeout string `mapstructure:"timeout"` }
Config is the database connection configuration.
type ConnectionDetails ¶
type ConnectionDetails struct { Dialect string Username string Password string Host string Port int Database string Encoding string Timeout string Pool int }
ConnectionDetails represents database connection details.
func NewConnectionDetails ¶
func NewConnectionDetails(config *Config) ConnectionDetails
NewConnectionDetails creates a new ConnectionDetails struct from a DB configuration.
func (ConnectionDetails) String ¶
func (cd ConnectionDetails) String() string
String builds a connection string from a database Config.
func (ConnectionDetails) StringWithoutDB ¶
func (cd ConnectionDetails) StringWithoutDB() string
StringWithoutDB builds a connection string from a database Config without the database.
Click to show internal directories.
Click to hide internal directories.