Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBootConfigKey ¶
func GetBootConfigKey() string
Types ¶
type DBConfig ¶
type DBConfig struct {
NamedDBs map[string]dbConfig `json:"dbs"`
}
All db injected with its inject name like "db_clients.test-db" to objects_container. db name "default" is also injected without inject name
type Foo struct {
SqlAgent *sqlagent.SqlAgent `inject:""` // get default db, same with `inject:"db_clients.default"`
TestSqlAgent *sqlagent.SqlAgent `inject:"db_clients.test-db"` // get test-db db
}
** DBConfig config json format ** {
"dbs": {
"test-db": {
"db": {
"host": "127.0.0.1",
"port": 3306,
"name": "test",
"type": "mysql",
"user": "test",
"password": "",
"parameters": {
"parseTime": "true",
"charset": "utf8mb4,utf8",
"loc": "Asia/Shanghai"
},
},
"connection": {
"max_open_connections": 60,
"max_idle_connections": 40,
"max_life_time": 600
},
"sql": {
"column_map_tag": "json"
}
}
}
}
Click to show internal directories.
Click to hide internal directories.