indexer

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package indexer provides symlink-based indexer for on-disk document-directories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdxAddResult

type IdxAddResult struct {
	Field, Value string
}

IdxAddResult represents the result of an Add call on an index

type Indexer

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

Indexer is a facade to configure and query over multiple indices.

func CreateIndexer

func CreateIndexer(storage metadata.Storage) *Indexer

CreateIndexer creates a new Indexer.

func (*Indexer) Add

func (i *Indexer) Add(t interface{}) ([]IdxAddResult, error)

Add a new entry to the indexer

func (*Indexer) AddIndex

func (i *Indexer) AddIndex(t interface{}, indexBy option.IndexBy, pkName, entityDirName, indexType string, bound *option.Bound, caseInsensitive bool) error

AddIndex adds a new index to the indexer receiver.

func (*Indexer) Delete

func (i *Indexer) Delete(t interface{}) error

Delete deletes all indexed fields of a given type t on the Indexer.

func (*Indexer) FindBy

func (i *Indexer) FindBy(t interface{}, findBy, val string) ([]string, error)

FindBy finds a value on an index by field and value.

func (*Indexer) FindByPartial

func (i *Indexer) FindByPartial(t interface{}, field string, pattern string) ([]string, error)

FindByPartial allows for glob search across all indexes.

func (*Indexer) Query

func (i *Indexer) Query(ctx context.Context, t interface{}, q string) ([]string, error)

Query parses an OData query into something our indexer.Index understands and resolves it.

func (*Indexer) Reset

func (i *Indexer) Reset() error

Reset takes care of deleting all indices from storage and from the internal map of indices

func (*Indexer) Update

func (i *Indexer) Update(from, to interface{}) error

Update updates all indexes on a value <from> to a value <to>.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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