index

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index interface {
	Add(docId string, v interface{}, ttl time.Duration) error
	Remove(docId string, v interface{}) error
	Iterate(reverse bool, onValue func(docId string) error) error
	Drop() error
	Type() IndexType
	Collection() string
	Field() string
}

func CreateIndex

func CreateIndex(collection, field string, idxType IndexType, tx store.Tx) Index

type IndexInfo

type IndexInfo struct {
	Field string
	Type  IndexType
}

type IndexQuery

type IndexQuery interface {
	Run(onValue func(docId string) error) error
}

type IndexType

type IndexType int
const (
	IndexSingleField IndexType = iota
)

type Range

type Range struct {
	Start, End                 interface{}
	StartIncluded, EndIncluded bool
}

func (*Range) Intersect

func (r1 *Range) Intersect(r2 *Range) *Range

func (*Range) IsEmpty

func (r *Range) IsEmpty() bool

func (*Range) IsNil

func (r *Range) IsNil() bool

type RangeIndex

type RangeIndex interface {
	Index
	IterateRange(vRange *Range, reverse bool, onValue func(docId string) error) error
}

type RangeIndexQuery

type RangeIndexQuery struct {
	Range   *Range
	Reverse bool
	Idx     RangeIndex
}

func (*RangeIndexQuery) Run

func (q *RangeIndexQuery) Run(onValue func(docId string) error) error

Jump to

Keyboard shortcuts

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