1 Star 0 Fork 0

linxing/youye-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
database.go 887 Bytes
一键复制 编辑 原始数据 按行查看 历史
Mark 提交于 2024-06-06 16:48 . 添加db 自动合并修改配置
package config
const (
MySQL = "mysql"
Postgres = "postgres"
SQLite = "sqlite"
)
type Database struct {
Driver string `yaml:"driver"`
Source string `yaml:"source"`
ConnMaxIdleTime int `yaml:"connMaxIdleTime"`
ConnMaxLifeTime int `yaml:"connMaxLifeTime"`
MaxIdleConns int `yaml:"maxIdleConns"`
MaxOpenConns int `yaml:"maxOpenConns"`
AutoMigrate bool `yaml:"autoMigrate"`
Registers []DBResolverConfig `yaml:"registers"`
Logger *Logger `yaml:"logger"`
}
type DBResolverConfig struct {
Sources []string `yaml:"sources"`
Replicas []string `yaml:"replicas"`
Policy string `yaml:"policy"`
Tables []string `yaml:"tables"`
}
var (
DatabaseConfig = new(Database)
DatabasesConfig = make(map[string]*Database)
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linxing_3/youye-core.git
git@gitee.com:linxing_3/youye-core.git
linxing_3
youye-core
youye-core
v0.0.1-202407111759

搜索帮助