Versions in this module Expand all Collapse all v0 v0.0.1 Aug 4, 2026 Changes in this version + func CleanKey(s string) string + type Cache struct + func New(opts Options) *Cache + func (c *Cache) ClearMatching(predicatePartition func(k string, p PartitionManager) bool, ...) + func (c *Cache) ClearOnRebuild(predicate func(k, v any) bool, changeset ...identity.Identity) + func (c *Cache) DrainEvictedIdentities() []KeyIdentity + func (c *Cache) DrainEvictedIdentitiesMatching(predicate func(KeyIdentity) bool) []KeyIdentity + func (c *Cache) Keys(predicate func(s string) bool) []string + func (c *Cache) Stop() + type ClearWhen int + const ClearNever + const ClearOnChange + const ClearOnRebuild + type KeyIdentity struct + Identity identity.Identity + Key any + type Options struct + CheckInterval time.Duration + Log loggers.Logger + MaxSize int + MinMaxSize int + Watching bool + type OptionsPartition struct + ClearWhen ClearWhen + Weight int + func (o OptionsPartition) CalculateMaxSize(maxSizePerPartition int) int + func (o OptionsPartition) WeightFraction() float64 + type Partition struct + func GetOrCreatePartition[K comparable, V any](c *Cache, name string, opts OptionsPartition) *Partition[K, V] + func (p *Partition[K, V]) Clear() + func (p *Partition[K, V]) Get(ctx context.Context, key K) (V, bool) + func (p *Partition[K, V]) GetOrCreate(key K, create func(key K) (V, error)) (V, error) + func (p *Partition[K, V]) GetOrCreateWitTimeout(key K, duration time.Duration, create func(key K) (V, error)) (V, error) + func (p *Partition[K, V]) Keys() []K + type PartitionManager interface