search

package
v0.0.0-...-9518a5e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package search defines an interface for a search index management structure

Index

Constants

View Source
const (
	// ElasticsearchProvider represents the elasticsearch search index provider.
	ElasticsearchProvider = "elasticsearch"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Provider string `json:"provider" mapstructure:"provider" toml:"provider,omitempty"`
	// contains filtered or unexported fields
}

Config contains settings regarding search indices.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

type IndexManager

type IndexManager interface {
	Index(ctx context.Context, id string, value interface{}) error
	Search(ctx context.Context, query, accountID string) (ids []string, err error)
	SearchForAdmin(ctx context.Context, query string) (ids []string, err error)
	Delete(ctx context.Context, id string) (err error)
}

IndexManager is our wrapper interface for a text search index.

type IndexManagerProvider

type IndexManagerProvider func(context.Context, logging.Logger, *http.Client, IndexPath, IndexName, ...string) (IndexManager, error)

IndexManagerProvider is a function that provides an IndexManager for a given index.

type IndexName

type IndexName string

IndexName is a type alias for dependency injection's sake.

type IndexPath

type IndexPath string

IndexPath is a type alias for dependency injection's sake.

Directories

Path Synopsis
Package elasticsearch provides an interface-compatible wrapper around the elasticsearch indexer
Package elasticsearch provides an interface-compatible wrapper around the elasticsearch indexer
Package mocksearch provides an interface-compatible search index mock
Package mocksearch provides an interface-compatible search index mock

Jump to

Keyboard shortcuts

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