Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Information ¶
type Option ¶
type Option func(s *sharding)
func WithCreateTable ¶
func WithPrimaryKey ¶
func WithStorage ¶
func WithStrategy ¶
type Sharding ¶
type Sharding interface { InitializeSharding(ctx context.Context) error Insert(ctx context.Context, record Record) error BatchInsert(ctx context.Context, records []Record) error Find(ctx context.Context, condition *Condition, offset, limit int) ([]Record, int64, error) FindOne(ctx context.Context, condition *Condition) (Record, error) Count(ctx context.Context, condition *Condition) (int64, error) }
type Storage ¶
type Storage interface { Count(ctx context.Context, name string, condition *Condition) int64 Get(ctx context.Context, name string, condition *Condition, offset, limit int) ([]*Item, error) Exist(ctx context.Context, name string, condition *Condition) bool Put(ctx context.Context, name string, condition *Condition, items []*Item) error Del(ctx context.Context, name string, condition *Condition) }
type StrategyFunc ¶
func (StrategyFunc) TableSuffix ¶
func (f StrategyFunc) TableSuffix(record Record, column string) (string, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.