Versions in this module Expand all Collapse all v1 v1.1.7 Apr 1, 2021 Changes in this version + var ErrNotFound = fmt.Errorf("not found") + var MapType = reflect.MapOf(reflect.TypeOf(""), reflect.TypeOf("")).Kind() + func IsUintType(k reflect.Kind) (size int, okay bool) + type CompoundIndex struct + AllowMissing bool + Indexes []Indexer + func (c *CompoundIndex) FromArgs(args ...interface{}) ([]byte, error) + func (c *CompoundIndex) FromObject(raw interface{}) (bool, []byte, error) + func (c *CompoundIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type ConditionalIndex struct + Conditional ConditionalIndexFunc + func (c *ConditionalIndex) FromArgs(args ...interface{}) ([]byte, error) + func (c *ConditionalIndex) FromObject(obj interface{}) (bool, []byte, error) + type ConditionalIndexFunc func(obj interface{}) (bool, error) + type DBSchema struct + Tables map[string]*TableSchema + func (s *DBSchema) Validate() error + type FieldSetIndex struct + Field string + func (f *FieldSetIndex) FromArgs(args ...interface{}) ([]byte, error) + func (f *FieldSetIndex) FromObject(obj interface{}) (bool, []byte, error) + type FilterFunc func(interface{}) bool + type FilterIterator struct + func NewFilterIterator(wrap ResultIterator, filter FilterFunc) *FilterIterator + func (f *FilterIterator) Next() interface{} + func (f *FilterIterator) WatchCh() <-chan struct{} + type IndexSchema struct + AllowMissing bool + Indexer Indexer + Name string + Unique bool + func (s *IndexSchema) Validate() error + type Indexer interface + FromArgs func(args ...interface{}) ([]byte, error) + type MemDB struct + func NewMemDB(schema *DBSchema) (*MemDB, error) + func (db *MemDB) Snapshot() *MemDB + func (db *MemDB) Txn(write bool) *Txn + type MultiIndexer interface + FromObject func(raw interface{}) (bool, [][]byte, error) + type PrefixIndexer interface + PrefixFromArgs func(args ...interface{}) ([]byte, error) + type ResultIterator interface + Next func() interface{} + WatchCh func() <-chan struct{} + type SingleIndexer interface + FromObject func(raw interface{}) (bool, []byte, error) + type StringFieldIndex struct + Field string + Lowercase bool + func (s *StringFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (s *StringFieldIndex) FromObject(obj interface{}) (bool, []byte, error) + func (s *StringFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type StringMapFieldIndex struct + Field string + Lowercase bool + func (s *StringMapFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (s *StringMapFieldIndex) FromObject(obj interface{}) (bool, [][]byte, error) + type StringSliceFieldIndex struct + Field string + Lowercase bool + func (s *StringSliceFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (s *StringSliceFieldIndex) FromObject(obj interface{}) (bool, [][]byte, error) + func (s *StringSliceFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type TableSchema struct + Indexes map[string]*IndexSchema + Name string + func (s *TableSchema) Validate() error + type Txn struct + func (txn *Txn) Abort() + func (txn *Txn) Commit() + func (txn *Txn) Defer(fn func()) + func (txn *Txn) Delete(table string, obj interface{}) error + func (txn *Txn) DeleteAll(table, index string, args ...interface{}) (int, error) + func (txn *Txn) DeletePrefix(table string, prefix_index string, prefix string) (bool, error) + func (txn *Txn) First(table, index string, args ...interface{}) (interface{}, error) + func (txn *Txn) FirstWatch(table, index string, args ...interface{}) (<-chan struct{}, interface{}, error) + func (txn *Txn) Get(table, index string, args ...interface{}) (ResultIterator, error) + func (txn *Txn) Insert(table string, obj interface{}) error + func (txn *Txn) LongestPrefix(table, index string, args ...interface{}) (interface{}, error) + type UUIDFieldIndex struct + Field string + func (u *UUIDFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (u *UUIDFieldIndex) FromObject(obj interface{}) (bool, []byte, error) + func (u *UUIDFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type UintFieldIndex struct + Field string + func (u *UintFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (u *UintFieldIndex) FromObject(obj interface{}) (bool, []byte, error) + type WatchSet map[<-chan struct{}]struct + func NewWatchSet() WatchSet + func (w WatchSet) Add(watchCh <-chan struct{}) + func (w WatchSet) AddWithLimit(softLimit int, watchCh <-chan struct{}, altCh <-chan struct{}) + func (w WatchSet) Watch(timeoutCh <-chan time.Time) bool + func (w WatchSet) WatchCtx(ctx context.Context) error