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) 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 PolicyFunc
- type RandomPolicy
- type ResolverMode
- type ResolverModeKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResolverModeLogger ¶ added in v1.4.0
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) 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 Policy ¶
func RoundRobinPolicy ¶ added in v1.5.2
func RoundRobinPolicy() Policy
func StrictRoundRobinPolicy ¶ added in v1.5.2
func StrictRoundRobinPolicy() Policy
type PolicyFunc ¶ added in v1.5.2
type RandomPolicy ¶
type RandomPolicy struct { }
type ResolverMode ¶ added in v1.4.0
type ResolverMode string
const ( ResolverModeSource ResolverMode = "source" ResolverModeReplica ResolverMode = "replica" )
type ResolverModeKey ¶ added in v1.4.0
type ResolverModeKey string
Click to show internal directories.
Click to hide internal directories.