Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connection ¶
Connection 初始化默认连接 Connection(name) name default is "default" Connection(name, filename)
Types ¶
type Config ¶
type Config struct {
// 连接地址
Host string `yaml:"host"`
// 链接端口号
Port string `yaml:"port"`
// 数据库,没有则默认为0
Database string `yaml:"database"`
// 数据库链接账号
UserName string `yaml:"username"`
// 密码,如果没有则为空
Password string `yaml:"password"`
TablePrefix string `yaml:"prefix"`
// 最大空闲连接数
MaxOpenConn int `yaml:"maxopenconn"`
// 最大连接数
MaxIdleConn int `yaml:"maxidleconn"`
// 最大连接时间
MaxLifeTime time.Duration `yaml:"maxlifetime"`
Debug bool `yaml:"debug"`
SkipDefaultTransaction bool `yaml:"skip_default_transaction"`
PrepareStmt bool `yaml:"prepare_stmt"`
}
Click to show internal directories.
Click to hide internal directories.