gofiber-study/common/config/config.go
Shikong cd33f1e307 添加数据源配置
添加数据源重载
2022-10-04 00:24:41 +08:00

28 lines
640 B
Go

package config
type BasicConfig struct {
Server ServerConfig `yaml:"server"`
Mysql struct {
DataSources []string `yaml:"dataSources"`
} `yaml:"mysql"`
}
type ServerConfig struct {
// 监听 地址:端口
Addr string `yaml:"addr"`
// 是否开启多进程
PreFork bool `yaml:"preFork"`
// 路由 大小写严格
CaseSensitive bool `yaml:"caseSensitive"`
// 严格路由 例: 设置为 true 时, /foo != /foo/
StrictRouting bool `yaml:"strictRouting"`
// 设置 Http 请求头中的 Server 名称
ServerHeader string `yaml:"serverHeader"`
}
type RedisConfig struct {
Addr string `yaml:"addr"`
Pass string `yaml:"pass"`
}