cache

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Unlicense Imports: 8 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

func HashQuery

func HashQuery(req *qry.VectorSearchRequest) uint64

HashQuery computes a unique 64-bit hash for a VectorSearchRequest. It considers all fields that affect the search result: - Dataset - Vector (elements) - K - Filters (recursively) - TextQuery (Hybrid) - Alpha - GraphAlpha - LocalOnly (maybe? usually same result regardless of where it runs, but context matters)

Types

type CacheStats

type CacheStats struct {
	Hits   int64
	Misses int64
	Items  int
}

type QueryCache

type QueryCache[T any] struct {
	// contains filtered or unexported fields
}

func NewQueryCache

func NewQueryCache[T any](capacity int, ttl time.Duration, namespace string) *QueryCache[T]

func (*QueryCache[T]) Clear

func (c *QueryCache[T]) Clear()

func (*QueryCache[T]) Get

func (c *QueryCache[T]) Get(key string) (T, bool)

func (*QueryCache[T]) GetInt

func (c *QueryCache[T]) GetInt(key int) (T, bool)

func (*QueryCache[T]) GetUint64

func (c *QueryCache[T]) GetUint64(key uint64) (T, bool)

func (*QueryCache[T]) Put

func (c *QueryCache[T]) Put(key string, val T)

func (*QueryCache[T]) PutInt

func (c *QueryCache[T]) PutInt(key int, val T)

func (*QueryCache[T]) PutUint64

func (c *QueryCache[T]) PutUint64(key uint64, val T)

func (*QueryCache[T]) Set

func (c *QueryCache[T]) Set(key string, val T)

func (*QueryCache[T]) SetInt

func (c *QueryCache[T]) SetInt(key int, val T)

Jump to

Keyboard shortcuts

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