Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
This section is empty.
Types ¶
type Configure ¶
func NewConfigure ¶
func NewConfigure( dsn string, maxIdleConns, maxOpenConns, connMaxIdleTime, connMaxLifetime int, registers []ResolverConfigure) Configure
NewConfigure 初始化 Configure
type DBResolverConfig ¶
type Database ¶
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"` Registers []DBResolverConfig `yaml:"registers"` }
type ResolverConfigure ¶
type ResolverConfigure interface {
Init(*dbresolver.DBResolver, func(string) gorm.Dialector) *dbresolver.DBResolver
}
func NewResolverConfigure ¶
func NewResolverConfigure(sources, replicas []string, policy string, tables []string) ResolverConfigure
NewResolverConfigure 初始化 ResolverConfigure
Click to show internal directories.
Click to hide internal directories.