index

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LineBreak            = "\r\n"
	IndexKeyValSeperator = "="
)

Variables

This section is empty.

Functions

func GenRowID

func GenRowID(name string) (string, error)

GenRowID generates hash for the given filename. The length of hash is 16

func UpdateLazyCache

func UpdateLazyCache(index *Index) error

UpdateLazyCache - updates index data in lay writer cache

Types

type Entry

type Entry struct {
	Key   string
	Value string
}

type Index

type Index struct {
	IndexID          string       `json:"indexId"`
	IndexNameQuery   string       `json:"indexNameQuery"`
	BucketSequence   []string     `json:"bucketSequence"`
	IndexFields      []IndexField `json:"indexFields"`
	IsDynamicName    bool         `json:"isDynamicName"`
	IndexFilePath    string
	SecurityProvider securityprovider.SecurityProvider
	// contains filtered or unexported fields
}

Index - Index

func NewIndex

func NewIndex(indexID, indexNameQuery string, IsDynamicName bool, indexFilePath string) (*Index, error)

func (*Index) AddEntries

func (i *Index) AddEntries(keyValMap map[string]string) error

func (*Index) AddEntry

func (i *Index) AddEntry(path string, rs *gjson.Result) error

func (*Index) CloseStore

func (i *Index) CloseStore() error

func (*Index) CreateIndex

func (i *Index) CreateIndex() error

func (*Index) Delete

func (i *Index) Delete(path string) error

func (*Index) DeleteMany

func (i *Index) DeleteMany(paths []string) error

func (*Index) GetAllEntries

func (i *Index) GetAllEntries() (map[string]string, error)

func (*Index) GetEntriesByOrQueries added in v1.2.5

func (i *Index) GetEntriesByOrQueries(queries []string) (map[string]string, error)

DhawalD - Added GetEntriesByOrQueries - 31-July-2021

func (*Index) GetEntriesByQueries

func (i *Index) GetEntriesByQueries(queries []string) (map[string]string, error)

func (*Index) GetEntryByPath

func (i *Index) GetEntryByPath(path string) (string, error)

func (*Index) GetEntryByQueries

func (i *Index) GetEntryByQueries(queries []string) (Entry, bool, error)

func (*Index) LoadIndexEntriesFromFile

func (index *Index) LoadIndexEntriesFromFile() error

func (*Index) ReplaceIndex

func (i *Index) ReplaceIndex() error

func (*Index) SetFields

func (i *Index) SetFields(indexField ...IndexField) *Index

SetFields - SetFields

func (*Index) WriteIndexEntriesInFile

func (index *Index) WriteIndexEntriesInFile() error

LogFDBIndexFile -LogFDBIndexFile

type IndexField

type IndexField struct {
	FieldName string `json:"fieldName"`
	Query     string `json:"query"`
}

IndexField - IndexField

type IndexStore

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

func NewStore

func NewStore() (IndexStore, error)

NewStore - returns new store object

func (*IndexStore) AddMany

func (i *IndexStore) AddMany(keyValMap map[string]string) (err error)

func (IndexStore) Close

func (i IndexStore) Close() error

func (*IndexStore) Delete

func (i *IndexStore) Delete(key string) error

func (*IndexStore) Get

func (i *IndexStore) Get(path string) (val string, err error)

func (*IndexStore) GetMany

func (i *IndexStore) GetMany() (map[string]string, error)

func (*IndexStore) GetManyByOrQuery added in v1.2.5

func (i *IndexStore) GetManyByOrQuery(queries []string) (map[string]string, error)

GetManyByOrQuery - For getting many data by OR entry DhawalD - Added GetManyByOrQuery - 31-July-2021

func (*IndexStore) GetManyByQuery

func (i *IndexStore) GetManyByQuery(queries []string) (map[string]string, error)

func (*IndexStore) GetOneByQuery

func (i *IndexStore) GetOneByQuery(queries []string) (entry Entry, found bool, err error)

func (*IndexStore) Set

func (i *IndexStore) Set(key, value string) (err error)

Jump to

Keyboard shortcuts

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