Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MySQL ¶
type MySQL struct {
Host string `toml:"host" env:"MYSQL_HOST"`
Port string `toml:"port" env:"MYSQL_PORT"`
Username string `toml:"username" env:"MYSQL_USERNAME"`
Password string `toml:"password" env:"MYSQL_PASSWORD"`
Database string `toml:"database" env:"MYSQL_DATABASE"`
//应为使用的是mysql连接池,需要规划使用池的配置
//控制当前程序最多可以打开的mysql连接数
MaxOpenConn int `toml:"maxopenconn" env:"MYSQL_MAXOPENCONN"`
//控制mysql服用,
MaxIdleConn int `toml:"maxidleconn" env:"MYSQL_MAXIDLECONN"`
//一个链接的生命周期,和mysql配置也相联系
MaxLifeTime int `toml:"maxlifetime" env:"MYSQL_MAXLIFETIME"`
//空闲链接的超时时常
MaxIdleTime int `toml:"maxidletime" env:"MYSQL_MAXIDLETIME"`
}
Click to show internal directories.
Click to hide internal directories.