Documentation ¶
Index ¶
- Variables
- type Balancer
- type DBConfig
- type Database
- func (d *Database) Count(value interface{}) *gorm.DB
- func (d *Database) Exec(sql string, values ...interface{}) *gorm.DB
- func (d *Database) Find(query interface{}, args ...interface{}) *gorm.DB
- func (d *Database) First(query interface{}, args ...interface{}) *gorm.DB
- func (d *Database) Last(query interface{}, args ...interface{}) *gorm.DB
- func (d *Database) Raw(sql string, values ...interface{}) *gorm.DB
- func (d *Database) Save(value interface{}) *gorm.DB
- func (d *Database) Take(query interface{}, args ...interface{}) *gorm.DB
- func (d *Database) Where(query interface{}, args ...interface{}) *gorm.DB
- func (d *Database) WithMode(dbMode DbActionMode) *gorm.DB
- type DbActionMode
- type RandomBalancer
- type RoundRobalancer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EventBeforeDBSelect string = "before::select_db" EventAfterDBSelect string = "after:select_db" EventBeforeQueryRun string = "before::query_run" )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { // this makes sure, calls like Save Update etc, goes through default source db *gorm.DB Config DBConfig Hooks *hooks.EventStore }
type DbActionMode ¶
type DbActionMode string
var ( DbWriteMode DbActionMode = "write" DbReadMode DbActionMode = "read" )
type RandomBalancer ¶
type RandomBalancer struct {
// contains filtered or unexported fields
}
func NewRandomBalancer ¶
func NewRandomBalancer(resourceCount int) *RandomBalancer
func (*RandomBalancer) Get ¶
func (r *RandomBalancer) Get() int64
type RoundRobalancer ¶
type RoundRobalancer struct {
// contains filtered or unexported fields
}
func NewRoundRobalancer ¶
func NewRoundRobalancer(resourceCount int) *RoundRobalancer
func (*RoundRobalancer) Get ¶
func (r *RoundRobalancer) Get() int64
Click to show internal directories.
Click to hide internal directories.