Documentation ¶
Index ¶
- Variables
- func LookupPartitions(store *refstore.Store, parts badgerutils.Iterator[Partition], ...) badgerutils.Iterator[[]byte]
- func PopulateRoaring32(bm *roaring.Bitmap, iter badgerutils.Iterator[[]byte]) error
- func PopulateRoaring64(bm *roaring64.Bitmap, iter badgerutils.Iterator[[]byte]) error
- type Extension
- func (e *Extension[T]) Drop() error
- func (e *Extension[T]) Init(store badgerutils.BadgerStore, iter badgerutils.Iterator[*T]) error
- func (e *Extension[T]) Lookup(opts badger.IteratorOptions, args ...any) (badgerutils.Iterator[[]byte], error)
- func (e *Extension[T]) OnDelete(key []byte, value *T) error
- func (e *Extension[T]) OnSet(key []byte, old, new *T, opts ...any) error
- type Indexer
- type MapValueRetriever
- type Partition
- type ValueInjector
- type ValueRetriever
Constants ¶
This section is empty.
Variables ¶
var ErrUndefinedLookup = fmt.Errorf("undefined lookup")
ErrUndefinedLookup is an error for situations in which the indexer has no optimized lookup for the given arguments.
Functions ¶
func LookupPartitions ¶
func LookupPartitions( store *refstore.Store, parts badgerutils.Iterator[Partition], opts badger.IteratorOptions, ) badgerutils.Iterator[[]byte]
LookupPartitions returns an iterator that iterates over the keys in the given partition iterator.
func PopulateRoaring32 ¶
PopulateRoaring32 populates a roaring bitmap with 32-bit integers from an iterator of byte slices.
func PopulateRoaring64 ¶
PopulateRoaring64 populates a roaring bitmap with 64-bit integers from an iterator of byte slices.
Types ¶
type Extension ¶
type Extension[T any] struct { // contains filtered or unexported fields }
Extension is an extension for extensible stores that indexes the data with a given indexer.
func NewExtension ¶
NewExtension creates a new Extension.
func (*Extension[T]) Init ¶
func (e *Extension[T]) Init( store badgerutils.BadgerStore, iter badgerutils.Iterator[*T], ) error
Init implements the extensible.Extension interface.
func (*Extension[T]) Lookup ¶
func (e *Extension[T]) Lookup(opts badger.IteratorOptions, args ...any) (badgerutils.Iterator[[]byte], error)
Lookup queries the index with the given arguments and returns an iterator of keys.
type Indexer ¶
type Indexer[T any] interface { Index(v *T, set bool) ([]badgerutils.RawKVPair, error) Lookup(args ...any) (badgerutils.Iterator[Partition], error) }
Indexer is an indexer.
type MapValueRetriever ¶
type MapValueRetriever[T any] struct { // contains filtered or unexported fields }
MapValueRetriever is a value retriever that retrieves the given field paths of struct and encodes them to bytes.
func NewMapValueRetriever ¶
func NewMapValueRetriever[T any]( extractor schema.PathExtractor[T], encodeFunc func(any) ([]byte, error), paths ...string, ) *MapValueRetriever[T]
NewMapValueRetriever creates a new map value retriever for the given struct type and field paths.
func (*MapValueRetriever[T]) RetrieveValue ¶
func (r *MapValueRetriever[T]) RetrieveValue(v *T) ([]byte, error)
RetrieveValue implements the ValueRetriever interface.
type Partition ¶
Partition represents a range of keys from low to high with optional exclusivity on both ends.
type ValueInjector ¶
type ValueInjector[T any] struct { // contains filtered or unexported fields }
Indexer is a wrapper around an Indexer that injects custom values to the indexes.
func NewValueInjector ¶
func NewValueInjector[T any]( indexer Indexer[T], retriever ValueRetriever[T], ) *ValueInjector[T]
NewValueInjector creates a new value injector for the given indexer and value retriever
func (*ValueInjector[T]) Index ¶
func (i *ValueInjector[T]) Index(v *T, set bool) ([]badgerutils.RawKVPair, error)
Index implements the Indexer interface.
func (*ValueInjector[T]) Lookup ¶
func (i *ValueInjector[T]) Lookup(args ...any) (badgerutils.Iterator[Partition], error)
Lookup implements the Indexer interface.
type ValueRetriever ¶
ValueRetriever is an interface that retrieves index custom values for index only scans from the indexed type.