indexer

package
v0.0.0-...-499b85e Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 16 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(cfg *config.Config) *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, 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{}, field string, 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(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
Package config should be moved to internal
Package config should be moved to internal
cs3

Jump to

Keyboard shortcuts

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