Documentation
¶
Index ¶
- func LookupChunks(store *refstore.Instance, parts badgerutils.Iterator[[]byte, Chunk], ...) badgerutils.Iterator[[]byte, []byte]
- func NewExtension[K, V any](indexer Indexer[V]) extstore.Extension[K, V]
- func PopulateRoaring32(bm *roaring.Bitmap, iter badgerutils.Iterator[[]byte, []byte]) error
- func PopulateRoaring64(bm *roaring64.Bitmap, iter badgerutils.Iterator[[]byte, []byte]) error
- type Chunk
- type Extension
- type ExtensionInstance
- func (e *ExtensionInstance[K, V]) Lookup(opts badger.IteratorOptions, args ...any) (badgerutils.Iterator[[]byte, []byte], error)
- func (e *ExtensionInstance[K, V]) OnDelete(_ context.Context, key K, value *V) error
- func (e *ExtensionInstance[K, V]) OnSet(ctx context.Context, key K, old, new *V, opts ...any) error
- func (e *ExtensionInstance[K, V]) SupportedQueries() []string
- func (e *ExtensionInstance[K, V]) SupportedValues() []string
- type IndexDescriptor
- type Indexer
- type MapValueRetriever
- type ValueInjector
- type ValueRetriever
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookupChunks ¶
func LookupChunks( store *refstore.Instance, parts badgerutils.Iterator[[]byte, Chunk], opts badger.IteratorOptions, ) badgerutils.Iterator[[]byte, []byte]
LookupChunks returns an iterator that iterates over the keys in the given chunk iterator.
func NewExtension ¶
NewExtension creates a new Extension.
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 Chunk ¶
Chunk represents a range of keys from low to high with optional exclusivity on both ends.
type Extension ¶
type Extension[K, V any] struct { // contains filtered or unexported fields }
Extension is an extension for extensible stores that indexes the data with a given indexer.
func (*Extension[K, V]) Instantiate ¶
func (e *Extension[K, V]) Instantiate(txn *badger.Txn) extstore.ExtensionInstance[K, V]
Instantiate implements the extensible.Extension interface.
func (*Extension[K, V]) RegisterStore ¶
func (e *Extension[K, V]) RegisterStore(store badgerutils.Instantiator[badgerutils.BadgerStore])
Init implements the extensible.Extension interface.
type ExtensionInstance ¶
type ExtensionInstance[K, V any] struct { // contains filtered or unexported fields }
func (*ExtensionInstance[K, V]) Lookup ¶
func (e *ExtensionInstance[K, V]) Lookup(opts badger.IteratorOptions, args ...any) (badgerutils.Iterator[[]byte, []byte], error)
Lookup queries the index with the given arguments and returns an iterator of keys.
func (*ExtensionInstance[K, V]) OnDelete ¶
func (e *ExtensionInstance[K, V]) OnDelete(_ context.Context, key K, value *V) error
OnDelete implements the extensible.Extension interface.
func (*ExtensionInstance[K, V]) OnSet ¶
func (e *ExtensionInstance[K, V]) OnSet(ctx context.Context, key K, old, new *V, opts ...any) error
OnSet implements the extensible.Extension interface.
func (*ExtensionInstance[K, V]) SupportedQueries ¶
func (e *ExtensionInstance[K, V]) SupportedQueries() []string
SupportedQueries returns the supported queries of the index.
func (*ExtensionInstance[K, V]) SupportedValues ¶
func (e *ExtensionInstance[K, V]) SupportedValues() []string
SupportedValues returns the supported values of the index.
type IndexDescriptor ¶
IndexDescriptor is an index describer.
type Indexer ¶
type Indexer[T any] interface { Index(v *T, set bool) ([]badgerutils.RawKVPair, error) Lookup(args ...any) (badgerutils.Iterator[[]byte, Chunk], 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]) Paths ¶
func (r *MapValueRetriever[T]) Paths() []string
Paths implements the ValueRetriever interface.
func (*MapValueRetriever[T]) RetrieveValue ¶
func (r *MapValueRetriever[T]) RetrieveValue(v *T) ([]byte, error)
RetrieveValue implements the ValueRetriever interface.
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[[]byte, Chunk], error)
Lookup implements the Indexer interface.
func (*ValueInjector[T]) SupportedQueries ¶
func (i *ValueInjector[T]) SupportedQueries() []string
SupportedQueries implements the IndexDescriber interface.
func (*ValueInjector[T]) SupportedValues ¶
func (i *ValueInjector[T]) SupportedValues() []string
SupportedValues implements the IndexDescriber interface.