Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conf ¶
type Conf struct {
Addr string `yaml:"addr"` //连接地址,类似:localhost:3306
Password string `yaml:"password"` //数据库密码
User string `yaml:"user"` //用户名
DbName string `yaml:"db_name"` //数据库名称
Timeout int `yaml:"timeout"` //单位:秒钟 默认:3
WriteTimeout int `yaml:"write_timeout"` //单位:秒钟 默认:3
ReadTimeout int `yaml:"read_timeout"` //单位:秒钟 默认:3
MaxOpenConnections int `yaml:"max_open_connections"` //设置打开数据库连接的最大数量 默认:0(不限制)。
MaxIdleConnections int `yaml:"max_idle_connections"` //用于设置连接池中空闲连接的最大数量 默认:2
MaxLifetime int `yaml:"max_lifetime"` //单位:秒钟 设置了连接可复用的最大时间 默认:3s。
}
Conf mysql的配置字段
Click to show internal directories.
Click to hide internal directories.