indexer

package
v2.26.7 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 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 Field added in v2.2.0

type Field struct {
	Name  string
	Value string
}

Field combines the name and value of an indexed field.

func NewField added in v2.2.0

func NewField(name, value string) Field

NewField is a utility function to create a new Field.

type IdxAddResult

type IdxAddResult struct {
	Field, Value string
}

IdxAddResult represents the result of an Add call on an index

type Indexer

type Indexer interface {
	AddIndex(t interface{}, indexBy option.IndexBy, pkName, entityDirName, indexType string, bound *option.Bound, caseInsensitive bool) error
	Add(t interface{}) ([]IdxAddResult, error)
	FindBy(t interface{}, fields ...Field) ([]string, error)
	Delete(t interface{}) error
}

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

func CreateIndexer

func CreateIndexer(storage metadata.Storage) Indexer

CreateIndexer creates a new Indexer.

type StorageIndexer added in v2.1.0

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

StorageIndexer is the indexer implementation using metadata storage

func (*StorageIndexer) Add added in v2.1.0

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

Add a new entry to the indexer

func (*StorageIndexer) AddIndex added in v2.1.0

func (i *StorageIndexer) 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 (*StorageIndexer) Delete added in v2.1.0

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

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

func (*StorageIndexer) FindBy added in v2.1.0

func (i *StorageIndexer) FindBy(t interface{}, queryFields ...Field) ([]string, error)

FindBy finds a value on an index by fields. If multiple fields are given then they are handled like an or condition.

func (*StorageIndexer) FindByPartial added in v2.1.0

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

FindByPartial allows for glob search across all indexes.

func (*StorageIndexer) Query added in v2.1.0

func (i *StorageIndexer) 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 (*StorageIndexer) Reset added in v2.1.0

func (i *StorageIndexer) Reset() error

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

func (*StorageIndexer) Update added in v2.1.0

func (i *StorageIndexer) 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