cluster

package
v0.0.0-...-9da90e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COUMT_IS_EMPTY   = -1 // 尚未计数
	COUMT_IS_DYNAMIC = -2 // 不缓存计数
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchFunc

type FetchFunc func(db *gorm.DB) *gorm.DB

type Sharding

type Sharding struct {
	IsTableNameDesc bool
	DbNameMatch     string
	TableFilter     func(dbname, table string) bool
	*gorm.DB
	// contains filtered or unexported fields
}

func NewSharding

func NewSharding(db *gorm.DB, desc bool) *Sharding

func (*Sharding) CountSharding

func (s *Sharding) CountSharding(model ShardingModel) (count int64)

Count all

func (*Sharding) PaginateSharding

func (s *Sharding) PaginateSharding(model ShardingModel, page, size int, fetch FetchFunc) error

Select step by step.

type ShardingModel

type ShardingModel interface {
	BaseTableName() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL