feat:完善项目信息
This commit is contained in:
@ -2,16 +2,17 @@ package config
|
||||
|
||||
var (
|
||||
SettingInfo = new(Setting)
|
||||
EngineInfo = new(Engine)
|
||||
//RPCServerSettingInfo = new(RPCServerSetting)
|
||||
)
|
||||
|
||||
// Mysql 配置
|
||||
type Mysql struct {
|
||||
Database string `yaml:"database"`
|
||||
Host string `yaml:"host"`
|
||||
Port int `yaml:"port"`
|
||||
User string `yaml:"user"`
|
||||
Username string `yaml:"username"`
|
||||
Password string `yaml:"password"`
|
||||
DBName string `yaml:"db_name"`
|
||||
Parameters string `yaml:"parameters"`
|
||||
}
|
||||
|
||||
@ -60,25 +61,13 @@ type Setting struct {
|
||||
ESServer struct {
|
||||
Host string `yaml:"host"`
|
||||
} `yaml:"es_server"`
|
||||
|
||||
// Rate 限流器
|
||||
Rate struct {
|
||||
Limit int `yaml:"limit"`
|
||||
Capacity int `yaml:"capacity"`
|
||||
}
|
||||
|
||||
// Engine 配置
|
||||
Engine struct {
|
||||
Debug bool `yaml:"debug"`
|
||||
DBMode string `yaml:"db_mode"`
|
||||
MaxLifetime int `yaml:"max_lifetime"`
|
||||
MaxOpenConns int `yaml:"max_open_conns"`
|
||||
MaxIdleConns int `yaml:"max_idle_conns"`
|
||||
TablePrefix string `yaml:"table_prefix"`
|
||||
Complex bool `yaml:"complex"`
|
||||
Mysql *Mysql `yaml:"mysql"`
|
||||
Sqlite *Sqlite `yaml:"sqlite"`
|
||||
}
|
||||
|
||||
// Cache 缓存配置
|
||||
Cache struct {
|
||||
Type string `yaml:"type"`
|
||||
@ -102,6 +91,19 @@ type Setting struct {
|
||||
}
|
||||
}
|
||||
|
||||
// Engine 配置
|
||||
type Engine struct {
|
||||
Debug bool `yaml:"debug"`
|
||||
Mode string `yaml:"mode"`
|
||||
MaxLifetime int `yaml:"max_lifetime"`
|
||||
MaxOpenConns int `yaml:"max_open_conns"`
|
||||
MaxIdleConns int `yaml:"max_idle_conns"`
|
||||
Engines struct {
|
||||
Mysql *Mysql `yaml:"mysql"`
|
||||
Sqlite *Sqlite `yaml:"sqlite"`
|
||||
} `yaml:"engines"`
|
||||
}
|
||||
|
||||
// RPCServerSetting 配置
|
||||
type RPCServerSetting struct {
|
||||
Key int `yaml:"key"`
|
||||
|
Reference in New Issue
Block a user