Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DbConfig = map[string]interface{}{ "Default": "mysql_dev", "SetMaxOpenConns": 300, "SetMaxIdleConns": 10, "Connections": map[string]map[string]string{ "mysql_dev": { "host": "192.168.200.248", "username": "gcore", "password": "gcore", "port": "3306", "database": "test", "charset": "utf8", "protocol": "tcp", "prefix": "", "driver": "mysql", }, "mssql_dev": { "host": "192.168.200.248", "username": "gcore", "password": "gcore", "port": "1433", "database": "test", "prefix": "", "driver": "mssql", }, "postgres_dev": { "host": "localhost", "username": "postgres", "password": "", "port": "5432", "database": "test", "prefix": "", "driver": "postgres", }, "oracle_dev": { "username": "root", "password": "", "database": "test", "prefix": "", "driver": "oracle", }, "sqlite_dev": { "database": "./foo.db", "prefix": "", "driver": "sqlite3", }, }, }
DbConfig : 所有数据库配置 如果想从json读取, 只需要用这个struct读取出来, 然后在赋值给类似这个变量类型就可以了: map[string]interface{}
type Configer struct { Default string SetMaxOpenConns int SetMaxIdleConns int Connections map[string]map[string]string }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.