cache

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[K comparable, V any] interface {
	// Get retrieves a value from the cache
	Get(key K) (V, bool)

	// Set stores a value with cost, returning true if successful
	Set(key K, value V, cost int64) bool

	// SetWithTTL stores a value with cost and TTL, returning true if successful
	SetWithTTL(key K, value V, cost int64, ttl time.Duration) bool
}

Cache defines a generic interface compatible with Ristretto and other caches

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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