Documentation ¶
Index ¶
- Constants
- func DbExists() bool
- func IndexedSystems() ([]string, error)
- func NameKey(systemId string, name string) string
- func NewNamesIndex(cfg *config.UserConfig, systems []games.System, update func(IndexStatus)) (int, error)
- func SystemIndexed(system games.System) bool
- type IndexStatus
- type SearchResult
- func SearchNamesExact(systems []games.System, query string) ([]SearchResult, error)
- func SearchNamesPartial(systems []games.System, query string) ([]SearchResult, error)
- func SearchNamesRegexp(systems []games.System, query string) ([]SearchResult, error)
- func SearchNamesWords(systems []games.System, query string) ([]SearchResult, error)
Constants ¶
const (
BucketNames = "names"
)
Variables ¶
This section is empty.
Functions ¶
func IndexedSystems ¶
Return all systems indexed in the gamesdb
func NewNamesIndex ¶
func NewNamesIndex( cfg *config.UserConfig, systems []games.System, update func(IndexStatus), ) (int, error)
Given a list of systems, index all valid game files on disk and write a names index to the DB. Overwrites any existing names index, but does not clean up old missing files.
Takes a function which will be called with the current status of the index during key steps.
Returns the total number of files indexed.
func SystemIndexed ¶
Return true if a specific system is indexed in the gamesdb
Types ¶
type SearchResult ¶
func SearchNamesExact ¶
func SearchNamesExact(systems []games.System, query string) ([]SearchResult, error)
Return indexed names matching exact query (case insensitive).
func SearchNamesPartial ¶
func SearchNamesPartial(systems []games.System, query string) ([]SearchResult, error)
Return indexed names partially matching query (case insensitive).
func SearchNamesRegexp ¶
func SearchNamesRegexp(systems []games.System, query string) ([]SearchResult, error)
Return indexed names matching query using regular expression.
func SearchNamesWords ¶
func SearchNamesWords(systems []games.System, query string) ([]SearchResult, error)
Return indexed names that include every word in query (case insensitive).