feat✨ :添加资源管理中的需要开放的必开接口
This commit is contained in:
1 parent
117392bfe8
commit
5ff282c23d
7 files changed
+141
-12
No files matched your search
@@ -1,11 +1,28 @@
|
||||
package config
|
||||
|
||||
import "gorm.io/plugin/dbresolver"
|
||||
|
||||
type Database struct {
|
||||
Driver string
|
||||
Source string
|
||||
Driver string
|
||||
Source string
|
||||
ConnMaxIdleTime int
|
||||
ConnMaxLifetime int
|
||||
MaxIdleConns int
|
||||
MaxOpenConns int
|
||||
Registers []DBResolverConfig
|
||||
}
|
||||
|
||||
type DBResolverConfig struct {
|
||||
Sources []string
|
||||
Replicas []string
|
||||
Policy string
|
||||
Tables []string
|
||||
}
|
||||
|
||||
var (
|
||||
DatabaseConfig = new(Database)
|
||||
DatabasesConfig = make(map[string]*Database)
|
||||
Policies = map[string]dbresolver.Policy{
|
||||
"random": dbresolver.RandomPolicy{},
|
||||
}
|
||||
)
|
||||
Reference in new issue
Block a user