Versions in this module Expand all Collapse all v0 v0.2.0 Sep 30, 2023 Changes in this version + var DefaultNumberStepper = Stepper + func RegisterShardComputer(typ string, factory ShardComputerFactory) + type AutoIncrement struct + Option map[string]string + Type string + type DatabaseTable struct + Database string + Table string + type DatabaseTables map[string][]string + func (dt DatabaseTables) And(other DatabaseTables) DatabaseTables + func (dt DatabaseTables) IsConfused() bool + func (dt DatabaseTables) IsEmpty() bool + func (dt DatabaseTables) IsFullScan() bool + func (dt DatabaseTables) Largest() (db, tbl string) + func (dt DatabaseTables) Len() int + func (dt DatabaseTables) Or(other DatabaseTables) DatabaseTables + func (dt DatabaseTables) Smallest() (db, tbl string) + func (dt DatabaseTables) String() string + type FuncShardComputerFactory func([]string, string) (ShardComputer, error) + func (f FuncShardComputerFactory) Apply(columns []string, expr string) (ShardComputer, error) + type Range interface + HasNext func() bool + Next func() interface{} + type Rule struct + func (ru *Rule) Has(table string) bool + func (ru *Rule) MustVTable(name string) *VTable + func (ru *Rule) Range(f func(table string, vt *VTable) bool) + func (ru *Rule) RemoveVTable(table string) bool + func (ru *Rule) SetVTable(table string, vt *VTable) + func (ru *Rule) VTable(table string) (*VTable, bool) + func (ru *Rule) VTables() map[string]*VTable + type ShardColumn struct + Name string + Stepper Stepper + Steps int + type ShardComputer interface + Compute func(values ...proto.Value) (int, error) + Variables func() []string + func NewComputer(typ string, columns []string, expr string) (ShardComputer, error) + type ShardComputerFactory interface + Apply func(columns []string, expr string) (ShardComputer, error) + type ShardMetadata struct + Computer ShardComputer + ShardColumns []*ShardColumn + func (sm *ShardMetadata) GetShardColumn(name string) *ShardColumn + type Shards btree.BTree + func IntersectionShards(first, second *Shards, others ...*Shards) *Shards + func NewShards() *Shards + func UnionShards(first, second *Shards, others ...*Shards) *Shards + func (sd *Shards) Add(db, table uint32, otherTables ...uint32) + func (sd *Shards) Each(h func(db, tb uint32) bool) + func (sd *Shards) Len() int + func (sd *Shards) Max() (db, tb uint32, ok bool) + func (sd *Shards) Min() (db, tb uint32, ok bool) + func (sd *Shards) Remove(db, table uint32, otherTables ...uint32) + func (sd *Shards) String() string + type StepUnit int8 + const Uday + const Uhour + const Umonth + const Unum + const Ustr + const Uweek + const Uyear + func (u StepUnit) IsTime() bool + func (u StepUnit) String() string + type Stepper struct + N int + U StepUnit + func (s Stepper) After(offset interface{}) (interface{}, error) + func (s Stepper) Ascend(offset interface{}, n int) (Range, error) + func (s Stepper) Before(offset interface{}) (interface{}, error) + func (s Stepper) Descend(offset interface{}, n int) (Range, error) + func (s Stepper) String() string + type Topology struct + func (to *Topology) Each(onEach func(dbIdx, tbIdx int) (ok bool)) bool + func (to *Topology) Enumerate() DatabaseTables + func (to *Topology) EnumerateDatabases() []string + func (to *Topology) Exists(dbIdx, tbIdx int) bool + func (to *Topology) Largest() (db, tb string, ok bool) + func (to *Topology) Len() (dbLen int, tblLen int) + func (to *Topology) Render(dbIdx, tblIdx int) (string, string, bool) + func (to *Topology) SetRender(dbRender, tbRender func(int) string) + func (to *Topology) SetTopology(db int, tables ...int) + func (to *Topology) Smallest() (db, tb string, ok bool) + type VShard struct + DB *ShardMetadata + Table *ShardMetadata + func (vs *VShard) Len() int + func (vs *VShard) Variables() []string + type VTable struct + func (vt *VTable) AddVShards(shard *VShard) + func (vt *VTable) AllowFullScan() bool + func (vt *VTable) GetAutoIncrement() *AutoIncrement + func (vt *VTable) GetShardMetaDataJSON() (map[string]string, error) + func (vt *VTable) GetVShards() []*VShard + func (vt *VTable) HasVShard(keys ...string) bool + func (vt *VTable) Name() string + func (vt *VTable) SearchVShard(keys ...string) (*VShard, bool) + func (vt *VTable) SetAllowFullScan(allow bool) + func (vt *VTable) SetAutoIncrement(seq *AutoIncrement) + func (vt *VTable) SetName(name string) + func (vt *VTable) SetTopology(topology *Topology) + func (vt *VTable) Shard(inputs map[string]proto.Value) (uint32, uint32, error) + func (vt *VTable) Topology() *Topology v0.1.0-rc1 Sep 1, 2022