index

package
v0.0.0-...-5129a00 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareIndex

func PrepareIndex(creators map[string]Creator, cfg Config, games []GameSource) error

PrepareIndex handles creating index that will be used for searching purposes

Types

type Config

type Config struct {
	Filepath string
	Variant  string
	Name     string
	DocType  string
}

Config provides index information and settings

type Creator

type Creator interface {
	CreateIndex(string, []GameSource) error
}

Creator is responsible for new index creation

type Description

type Description struct {
	Synopsis string
}

Description provides information about

type GameHit

type GameHit struct {
	ID string
}

GameHit represent succesfull hit of a game

type GameSource

type GameSource struct {
	UID          string
	Name         string
	Descriptions []Description
}

GameSource provides information neccessary for game indexing

type Result

type Result struct {
	Hits             []GameHit
	IgnoredPlatforms []string
}

Result presents found game entries plus additional infromation, including ignored platforms requested etc.

type SearchParameters

type SearchParameters struct {
	Text      string
	Platforms []string
}

SearchParameters provide information what criteria for results are expected

type Searcher

type Searcher interface {
	Search(SearchParameters) (Result, error)
	AddIndex(Config) error
	Close() error
}

Searcher is used for searching in the indexes of the same type, eg. all bleve indexes could be aggregated to return batch of results

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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