concat

package
v0.0.0-...-f7bad0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxComponentSize is the default size that the binary representation of a component will be padded or truncated to.
	DefaultMaxComponentSize = 256
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

Component represents a component of concatenated keys in index

func NewComponent

func NewComponent(path string) Component

NewComponent creates a new component with the given path.

func (Component) Desc

func (comp Component) Desc() Component

Desc sets the descending flag of the component.

func (Component) IncludeType

func (comp Component) IncludeType() Component

IncludeType sets the includeType flag of the component.

func (Component) WithSize

func (comp Component) WithSize(size int) Component

Size modifies the size of the component.

type Indexer

type Indexer[T any] struct {
	// contains filtered or unexported fields
}

Indexer is an indexer for a struct type that generates keys base on struct fields for a btree index.

func New

func New[T any](
	extractor schema.PathExtractor[T],
	encoder codec.Encoder[any],
	comps ...Component,
) (*Indexer[T], error)

New creates a new indexer for the given struct type and components.

func (*Indexer[T]) Index

func (si *Indexer[T]) Index(v *T, set bool) ([]badgerutils.RawKVPair, error)

Index implements the Indexer interface.

func (*Indexer[T]) Lookup

func (si *Indexer[T]) Lookup(args ...any) (badgerutils.Iterator[expr.Range[[]byte]], error)

Lookup implements the Indexer interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL