Documentation ¶
Index ¶
- func NewResolverModeLogger(l logger.Interface) logger.Interface
- func Use(str string) clause.Expression
- type Config
- type DBResolver
- func (dr *DBResolver) Call(fc func(connPool gorm.ConnPool) error) error
- func (dr *DBResolver) Initialize(db *gorm.DB) error
- func (dr *DBResolver) Name() string
- func (dr *DBResolver) Register(config Config, datas ...interface{}) *DBResolver
- func (dr *DBResolver) Reset()
- func (dr *DBResolver) SetConnMaxIdleTime(d time.Duration) *DBResolver
- func (dr *DBResolver) SetConnMaxLifetime(d time.Duration) *DBResolver
- func (dr *DBResolver) SetMaxIdleConns(n int) *DBResolver
- func (dr *DBResolver) SetMaxOpenConns(n int) *DBResolver
- type Operation
- type Policy
- type RandomPolicy
- type ResolverMode
- type ResolverModeKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBResolver ¶
func Register ¶
func Register(config Config, datas ...interface{}) *DBResolver
func (*DBResolver) Initialize ¶
func (dr *DBResolver) Initialize(db *gorm.DB) error
func (*DBResolver) Name ¶
func (dr *DBResolver) Name() string
func (*DBResolver) Register ¶
func (dr *DBResolver) Register(config Config, datas ...interface{}) *DBResolver
func (*DBResolver) Reset ¶
func (dr *DBResolver) Reset()
func (*DBResolver) SetConnMaxIdleTime ¶
func (dr *DBResolver) SetConnMaxIdleTime(d time.Duration) *DBResolver
func (*DBResolver) SetConnMaxLifetime ¶
func (dr *DBResolver) SetConnMaxLifetime(d time.Duration) *DBResolver
func (*DBResolver) SetMaxIdleConns ¶
func (dr *DBResolver) SetMaxIdleConns(n int) *DBResolver
func (*DBResolver) SetMaxOpenConns ¶
func (dr *DBResolver) SetMaxOpenConns(n int) *DBResolver
type Operation ¶
type Operation string
Operation specifies dbresolver mode
func (Operation) ModifyStatement ¶
ModifyStatement modify operation mode
type RandomPolicy ¶
type RandomPolicy struct { }
type ResolverMode ¶
type ResolverMode string
const ( ResolverModeSource ResolverMode = "source" ResolverModeReplica ResolverMode = "replica" )
type ResolverModeKey ¶
type ResolverModeKey string
Click to show internal directories.
Click to hide internal directories.