Documentation ¶
Overview ¶
Package indexer provides symlink-based indexer for on-disk document-directories.
Index ¶
- type Field
- type IdxAddResult
- type Indexer
- type StorageIndexer
- func (i *StorageIndexer) Add(t interface{}) ([]IdxAddResult, error)
- func (i *StorageIndexer) AddIndex(t interface{}, indexBy option.IndexBy, pkName, entityDirName, indexType string, ...) error
- func (i *StorageIndexer) Delete(t interface{}) error
- func (i *StorageIndexer) FindBy(t interface{}, queryFields ...Field) ([]string, error)
- func (i *StorageIndexer) FindByPartial(t interface{}, field string, pattern string) ([]string, error)
- func (i *StorageIndexer) Query(ctx context.Context, t interface{}, q string) ([]string, error)
- func (i *StorageIndexer) Reset() error
- func (i *StorageIndexer) Update(from, to interface{}) error
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 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 ¶
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
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>.