index

package
v0.0.0-...-95e2e8c Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Fts5PropertyCollateAllowedValues = []string{"BINARY", "NOCASE", "RTIRM"}
View Source
var SqlitePropertyCollateAllowedValues = []string{"BINARY", "NOCASE", "RTIRM"}

Functions

func Close

func Close(indexes List) error

Types

type Config

type Config interface {
	Validate(inputs map[string]input.Config, log *logrus.Entry) error
	GetName() string
	DoesHandleProperty(property string) bool
	DoesHandleInput(input input.Config) bool
}

type Fts5

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

func NewFts5

func NewFts5(
	config *Fts5Config,
	inputs input.List,
) (*Fts5, error)

func (*Fts5) Close

func (sqlite *Fts5) Close() error

func (*Fts5) GetRecordPositions

func (sqlite *Fts5) GetRecordPositions(
	input input.Input,
	filters map[string]interface{},
) (record.PositionIterator, error)

func (*Fts5) Name

func (sqlite *Fts5) Name() string

type Fts5Config

type Fts5Config struct {
	Name       string   `yaml:"name"`
	Type       string   `yaml:"type"`
	Dsn        string   `yaml:"dsn"`
	Input      string   `yaml:"input"`
	Prefix     []int    `yaml:"prefix"`
	Tokenize   string   `yaml:"tokenize"`
	Properties []string `yaml:"properties"`
	Logger     *logrus.Entry
}

func (*Fts5Config) DoesHandleInput

func (config *Fts5Config) DoesHandleInput(input input.Config) bool

func (*Fts5Config) DoesHandleProperty

func (config *Fts5Config) DoesHandleProperty(propertyName string) bool

func (*Fts5Config) GetName

func (config *Fts5Config) GetName() string

func (*Fts5Config) Validate

func (config *Fts5Config) Validate(inputs map[string]input.Config, log *logrus.Entry) error

type Index

type Index interface {
	Name() string

	// Gets the indexed records matching all the given filters
	// The returned list is expected to be ordered from the
	// smallest position to the biggest
	GetRecordPositions(input input.Input, filters map[string]interface{}) (record.PositionIterator, error)

	Close() error
}

func NewFromConfig

func NewFromConfig(
	config Config,
	inputs input.List,
) (Index, error)

type List

type List = map[string]Index

func NewFromConfigs

func NewFromConfigs(
	configs map[string]Config,
	inputs input.List,
) (List, error)

type Map

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

func NewMap

func NewMap(
	config *MapConfig,
	inputs input.List,
) (*Map, error)

func (*Map) Close

func (mapIndex *Map) Close() error

func (*Map) GetRecordPositions

func (mapIndex *Map) GetRecordPositions(
	input input.Input,
	filters map[string]interface{},
) (record.PositionIterator, error)

func (*Map) Name

func (mapIndex *Map) Name() string

type MapConfig

type MapConfig struct {
	Name       string   `yaml:"name"`
	Type       string   `yaml:"type"`
	Input      string   `yaml:"input"`
	Properties []string `yaml:"properties"`
	Logger     *logrus.Entry
}

func (*MapConfig) DoesHandleInput

func (config *MapConfig) DoesHandleInput(input input.Config) bool

func (*MapConfig) DoesHandleProperty

func (config *MapConfig) DoesHandleProperty(property string) bool

func (*MapConfig) GetName

func (config *MapConfig) GetName() string

func (*MapConfig) Validate

func (config *MapConfig) Validate(inputs map[string]input.Config, log *logrus.Entry) error

type Noop

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

A noop index is able to search into any data, but very inefficiently. It does not index anything.

func NewNoop

func NewNoop(
	config *NoopConfig,
	inputs input.List,
) *Noop

func (*Noop) Close

func (noop *Noop) Close() error

func (*Noop) GetRecordPositions

func (noop *Noop) GetRecordPositions(
	input input.Input,
	filters map[string]interface{},
) (record.PositionIterator, error)

func (*Noop) Name

func (noop *Noop) Name() string

type NoopConfig

type NoopConfig struct {
	Name   string `yaml:"name"`
	Type   string `yaml:"type"`
	Logger *logrus.Entry
}

func (*NoopConfig) DoesHandleInput

func (config *NoopConfig) DoesHandleInput(input input.Config) bool

func (*NoopConfig) DoesHandleProperty

func (config *NoopConfig) DoesHandleProperty(property string) bool

func (*NoopConfig) GetName

func (config *NoopConfig) GetName() string

func (*NoopConfig) Validate

func (config *NoopConfig) Validate(inputs map[string]input.Config, log *logrus.Entry) error

type Sqlite

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

func NewSqlite

func NewSqlite(
	config *SqliteConfig,
	inputs input.List,
) (*Sqlite, error)

func (*Sqlite) Close

func (sqlite *Sqlite) Close() error

func (*Sqlite) GetRecordPositions

func (sqlite *Sqlite) GetRecordPositions(
	input input.Input,
	filters map[string]interface{},
) (record.PositionIterator, error)

func (*Sqlite) Name

func (sqlite *Sqlite) Name() string

type SqliteConfig

type SqliteConfig struct {
	Name       string                  `yaml:"name"`
	Type       string                  `yaml:"type"`
	Dsn        string                  `yaml:"dsn"`
	Input      string                  `yaml:"input"`
	Properties []*SqlitePropertyConfig `yaml:"properties"`
	Logger     *logrus.Entry
}

func (*SqliteConfig) DoesHandleInput

func (config *SqliteConfig) DoesHandleInput(input input.Config) bool

func (*SqliteConfig) DoesHandleProperty

func (config *SqliteConfig) DoesHandleProperty(propertyName string) bool

func (*SqliteConfig) GetName

func (config *SqliteConfig) GetName() string

func (*SqliteConfig) Validate

func (config *SqliteConfig) Validate(inputs map[string]input.Config, log *logrus.Entry) error

type SqlitePropertyConfig

type SqlitePropertyConfig struct {
	Name    string `yaml:"name"`
	Collate string `yaml:"collate"`
}

func (*SqlitePropertyConfig) Validate

func (config *SqlitePropertyConfig) Validate(log *logrus.Entry, logPrefix string) error

type Wildcard

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

func NewWildcard

func NewWildcard(
	config *WildcardConfig,
	inputs input.List,
) (*Wildcard, error)

func (*Wildcard) Close

func (wildcard *Wildcard) Close() error

func (*Wildcard) GetRecordPositions

func (wildcard *Wildcard) GetRecordPositions(
	input input.Input,
	filters map[string]interface{},
) (record.PositionIterator, error)

func (*Wildcard) Name

func (wildcard *Wildcard) Name() string

type WildcardConfig

type WildcardConfig struct {
	Name       string   `yaml:"name"`
	Type       string   `yaml:"type"`
	Path       string   `yaml:"path"`
	Input      string   `yaml:"input"`
	Properties []string `yaml:"properties"`
	IgnoreCase *bool    `yaml:"ignoreCase"`
	Logger     *logrus.Entry
}

func (*WildcardConfig) DoesHandleInput

func (config *WildcardConfig) DoesHandleInput(input input.Config) bool

func (*WildcardConfig) DoesHandleProperty

func (config *WildcardConfig) DoesHandleProperty(property string) bool

func (*WildcardConfig) GetName

func (config *WildcardConfig) GetName() string

func (*WildcardConfig) ShouldIgnoreCase

func (config *WildcardConfig) ShouldIgnoreCase() bool

func (*WildcardConfig) Validate

func (config *WildcardConfig) Validate(inputs map[string]input.Config, log *logrus.Entry) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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