secondcache

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cacheSize int) *secondChanceCache

func NewBytes

func NewBytes(cacheSize int) *secondChanceCacheBytes

NewBytes returns a cache holding at most cacheSize entries, keyed by a byte slice. cacheSize must be at least 1, as in NewTyped.

func NewTyped

func NewTyped[T any](cacheSize int) *typedSecondChanceCache[T]

NewTyped returns a cache holding at most cacheSize entries, which must be at least 1: the victim scan evicts into a fixed set of slots, so a smaller size leaves it nothing to index. Callers validate the size they pass, either against configuration (kvs.CacheSizeFromConfig) or by skipping the cache entirely (vault.NewCachedVault).

Types

type Slice

type Slice [64]byte

Jump to

Keyboard shortcuts

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