Versions in this module Expand all Collapse all v0 v0.2.0 Jul 22, 2026 v0.1.0 Jul 21, 2026 Changes in this version + type Cache interface + Clear func() + Delete func(key K) + Get func(key K) (V, bool) + Len func() int + Set func(key K, value V) + type Event struct + EventType string + IsCacheClear bool + Key K + TimestampMs int64 + type Handler struct + func NewHandler[K comparable, V any](cache Cache[K, V], source InvalidationSource[K], logger *slog.Logger) *Handler[K, V] + func (h *Handler[K, V]) Run(ctx context.Context) error + type InvalidationSource interface + Events func(ctx context.Context) <-chan Event[K] + Watermark func() int64 + type Loader func(ctx context.Context, key K) (V, error) + type LoadingCache struct + func NewLoadingCache[K comparable, V any](cache Cache[K, V], loader Loader[K, V]) *LoadingCache[K, V] + func (lc *LoadingCache[K, V]) GetOrLoad(ctx context.Context, key K) (V, error) + type MemCache struct + func NewMemCache[K comparable, V any](opts Options[K, V]) *MemCache[K, V] + func (c *MemCache[K, V]) Clear() + func (c *MemCache[K, V]) Delete(key K) + func (c *MemCache[K, V]) Get(key K) (V, bool) + func (c *MemCache[K, V]) Len() int + func (c *MemCache[K, V]) Set(key K, value V) + type MemorySource struct + func NewMemorySource[K comparable](buffer int) *MemorySource[K] + func (s *MemorySource[K]) Close() + func (s *MemorySource[K]) Events(_ context.Context) <-chan Event[K] + func (s *MemorySource[K]) Publish(ev Event[K]) + func (s *MemorySource[K]) Watermark() int64 + type Options struct + MaxEntries int + OnRemoval RemovalListener[K, V] + TTL time.Duration + type RemovalCause int + const CauseExpired + const CauseExplicit + const CauseReplaced + const CauseSize + func (c RemovalCause) String() string + type RemovalListener func(key K, value V, cause RemovalCause)