Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitDatabase ¶
func InitDatabase(config *DatabaseConfig) error
"root:root@tcp(localhost:3306)/user-service?charset=utf8&parseTime=True&loc=Local", &gorm.Config{}
Types ¶
type DatabaseConfig ¶
type DatabaseConfig struct { // User to connect to the database as. User string // Password to authenticate the user. Password string // Host URL to connect to. Host string // Port the server is exposed on. Port int // Database to use. Database string // Models to auto-migrate. Models []interface{} // ExtraConfig defines the GORM configuration options. ExtraConfig *gorm.Config }
DatabaseConfig defines the settings required to initialise a MySQL database connection.
Click to show internal directories.
Click to hide internal directories.