Versions in this module Expand all Collapse all v2 v2.0.1 Jun 7, 2026 Changes in this version + type Cache struct + func New[T any](ttl time.Duration) *Cache[T] + func (c *Cache[T]) GetOrFetch(ctx context.Context, fetch func(ctx context.Context) (T, error)) (T, error) + func (c *Cache[T]) Invalidate() + type KeyedCache struct + func NewKeyed[K comparable, T any]() *KeyedCache[K, T] + func (c *KeyedCache[K, T]) GetOrFetch(ctx context.Context, key K, valid func(cached T) bool, ...) (T, error) + func (c *KeyedCache[K, T]) Invalidate(key K) + func (c *KeyedCache[K, T]) InvalidateAll() + type StaleError struct + Err error + func (e *StaleError) Error() string + func (e *StaleError) Unwrap() error + type TTL struct + func NewTTL[V any](ttl time.Duration) *TTL[V] + func (c *TTL[V]) Delete(key string) + func (c *TTL[V]) DeleteFunc(fn func(key string, value V) bool) + func (c *TTL[V]) Get(key string) (V, bool) + func (c *TTL[V]) Put(key string, value V) Other modules containing this package github.com/getarcaneapp/arcane/backend