Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClient ¶
func NewMysqlPool ¶
Types ¶
type Cfg ¶
type Cfg struct {
// dial
Engine string `toml:"engine"` // postgressql/mysql
DialUser string `toml:"user"`
DialPawd string `toml:"pawd"`
DialHost string `toml:"host"`
DialPort string `toml:"port"`
DialName string `toml:"name"`
Debug bool `toml:"debug"` // 是否显示sql语句
// pool
PoolMaxOpenConn int `toml:"max_open_conn"` // 最大连接数大小
PoolMaxIdleConn int `toml:"max_idle_conn"` // 最大空闲的连接的个数
PoolConnMaxLifetime time.Duration `toml:"conn_max_lifetime"` // 连接的生命时间,超过此时间,连接将关闭后重新建立新的,0代表忽略相关判断,单位:second
}
Click to show internal directories.
Click to hide internal directories.
