Versions in this module Expand all Collapse all v1 v1.0.25 Jul 6, 2016 v1.0.24 Jun 27, 2016 v1.0.23 Jun 13, 2016 Changes in this version + var ErrNodeNotFound = errors.New(`node not found`) + var ErrTreeNotFound = errors.New(`tree not found`) + type Comparator func(item1, item2 interface{}) int + type Config struct + Comparator Comparator + NodeWidth int + Persister Persister + func DefaultConfig(persister Persister, comparator Comparator) Config + type ID []byte + func (z *ID) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z ID) MarshalMsg(b []byte) (o []byte, err error) + func (z ID) Msgsize() (s int) + type Item struct + Payload []byte + Value interface{} + type Key struct + Payload []byte + UUID ID + Value interface{} + func (k Key) ID() []byte + func (k Key) ToItem() *Item + func (z *Key) MarshalMsg(b []byte) (o []byte, err error) + func (z *Key) Msgsize() (s int) + func (z *Key) UnmarshalMsg(bts []byte) (o []byte, err error) + type Keys []*Key + func (z *Keys) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z Keys) MarshalMsg(b []byte) (o []byte, err error) + func (z Keys) Msgsize() (s int) + type MutableTree interface + AddItems func(items ...*Item) ([]*Item, error) + Commit func() (ReadableTree, error) + DeleteItems func(keys ...interface{}) ([]*Item, error) + type Node struct + ChildKeys Keys + ChildValues []interface{} + ID ID + IsLeaf bool + func (z *Node) MarshalMsg(b []byte) (o []byte, err error) + func (z *Node) Msgsize() (s int) + func (z *Node) UnmarshalMsg(bts []byte) (o []byte, err error) + type Payload struct + Key []byte + Payload []byte + type Persister interface + Load func(keys ...[]byte) ([]*Payload, error) + Save func(items ...*Payload) error + type ReadableTree interface + AsMutable func() MutableTree + func Load(p Persister, id []byte, comparator Comparator) (ReadableTree, error) + func New(cfg Config) ReadableTree + type Tr struct + Count int + NodeWidth int + Root ID + UUID ID + func (t *Tr) AddItems(its ...*Item) ([]*Item, error) + func (t *Tr) Apply(fn func(item *Item), keys ...interface{}) error + func (t *Tr) AsMutable() MutableTree + func (t *Tr) Commit() (ReadableTree, error) + func (t *Tr) DeleteItems(values ...interface{}) ([]*Item, error) + func (t *Tr) ID() ID + func (t *Tr) Len() int + func (z *Tr) MarshalMsg(b []byte) (o []byte, err error) + func (z *Tr) Msgsize() (s int) + func (z *Tr) UnmarshalMsg(bts []byte) (o []byte, err error) + type Tree interface + Apply func(fn func(item *Item), keys ...interface{}) error + ID func() ID + Len func() int