search

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache keeps lightweight per-library search snapshots in memory.

func NewCache

func NewCache(client *cache.Client, store *cache.Store) *Cache

NewCache creates a new in-memory search cache.

func (*Cache) Invalidate added in v0.3.0

func (c *Cache) Invalidate(libraryID string)

Invalidate removes the cached search snapshot for a library.

func (*Cache) Prepare

func (c *Cache) Prepare(ctx context.Context, libraryID, libraryMediaType string) error

Prepare ensures the library snapshot exists before the user starts searching.

func (*Cache) Search

func (c *Cache) Search(ctx context.Context, libraryID, libraryMediaType, query string) ([]abs.LibraryItem, error)

Search returns search results from a cached per-library snapshot.

type PersistedEntry added in v0.3.0

type PersistedEntry struct {
	ItemID    string
	LibraryID string
	MediaType string
	Title     string
	Author    string
	Duration  float64

	PodcastTitle    string
	EpisodeID       string
	EpisodeTitle    string
	EpisodeDuration float64

	SeriesID   string
	SeriesName string

	PrimarySearchText   string
	SecondarySearchText string
	CombinedSearchText  string
	FuzzySearchText     string
	PrimaryTokens       []string
	CombinedTokens      []string
}

PersistedEntry is a gob-serializable representation of snapshotEntry.

type PersistedSnapshot added in v0.3.0

type PersistedSnapshot struct {
	LibraryID      string
	MediaType      string
	BuiltAt        time.Time
	LastAccessedAt time.Time
	Entries        []PersistedEntry
}

PersistedSnapshot is a gob-serializable representation of a librarySnapshot for disk cache persistence.

Jump to

Keyboard shortcuts

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