Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBOptions ¶
type DBOptions struct {
Driver string `yaml:"driver"`
MysqlOptions *MysqlOptions `yaml:"mysqloptions"`
ESOptions *ESOptions `yaml:"esoptions"`
}
func InitConfig ¶
func NewDefaultOptions ¶
func NewDefaultOptions() *DBOptions
type ESOptions ¶
type ESOptions struct {
EndPoint string `yaml:"endpoint"`
Username string `yaml:"username"`
Password string `yaml:"password"`
}
func NewEsOptions ¶
func NewEsOptions() *ESOptions
type MysqlOptions ¶
type MysqlOptions struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
Username string `yaml:"username"`
Password string `yaml:"password"`
DBName string `yaml:"dbName"`
Charset string `yaml:"charset"`
ParseTime bool `yaml:"parseTime"`
MaxIdleConns int `yaml:"maxIdleConns"`
MaxOpenConns int `yaml:"maxOpenConns"`
MaxLifetime int `yaml:"maxLifetime"`
LogMode bool `yaml:"logMode"`
}
1. 定一个 MysqlOptions struct, 字段定一个存储client初始化需要的参数
func NewMysqlOptions ¶
func NewMysqlOptions() *MysqlOptions
Click to show internal directories.
Click to hide internal directories.