Versions in this module Expand all Collapse all v1 v1.6.0 Aug 26, 2026 v1.5.9 Aug 13, 2026 Changes in this version + func DecodeKey(key string, n int) (parts []string, ok bool) + func EncodeKey(parts ...string) string + type Cache struct + func New[V any](capacity int, opts ...Option[V]) *Cache[V] + func (c *Cache[V]) Evict(key string) + func (c *Cache[V]) EvictByIndex(indexKey string) + func (c *Cache[V]) EvictWhere(pred func(key string) bool) + func (c *Cache[V]) Fill(ctx context.Context, key string, load Loader[V]) (V, error) + func (c *Cache[V]) Flush() + func (c *Cache[V]) Get(key string) (V, bool) + func (c *Cache[V]) Len() int + type Loader func() (value V, indexKey string, err error) + type Option func(*Cache[V]) + func WithValidator[V any](valid func(V) bool) Option[V]