Versions in this module Expand all Collapse all v0 v0.1.0 Oct 18, 2026 Changes in this version + var ErrInvalidOptions = errors.New("cache memory: invalid options") + type InvalidationBus struct + func NewInvalidationBus[K comparable]() *InvalidationBus[K] + func (b *InvalidationBus[K]) Publish(ctx context.Context, event cache.InvalidationEvent[K]) error + func (b *InvalidationBus[K]) Subscribe(ctx context.Context, namespace string, handler cache.InvalidationHandler[K]) error + func (b *InvalidationBus[K]) SubscriberCount(namespace string) int + type Locker struct + func NewLocker[K comparable]() *Locker[K] + func (l *Locker[K]) Lock(ctx context.Context, namespace string, key K, ttl time.Duration) (cache.Lease, error) + type Options struct + CleanupInterval time.Duration + MaxEntries int + type Store struct + func NewWithOptions[K comparable, V any](options Options) (*Store[K, V], error) + func New[K comparable, V any]() *Store[K, V] + func (s *Store[K, V]) Close() error + func (s *Store[K, V]) Get(ctx context.Context, namespace string, key K) (cache.Entry[V], bool, error) + func (s *Store[K, V]) GetMany(ctx context.Context, namespace string, keys []K) ([]cache.Entry[V], []bool, error) + func (s *Store[K, V]) Invalidate(ctx context.Context, namespace string, key K) error + func (s *Store[K, V]) InvalidateAll(ctx context.Context, namespace string) error + func (s *Store[K, V]) InvalidateMany(ctx context.Context, namespace string, keys []K) error + func (s *Store[K, V]) Len() int + func (s *Store[K, V]) Set(ctx context.Context, namespace string, key K, entry cache.Entry[V]) error + func (s *Store[K, V]) SetMany(ctx context.Context, namespace string, keys []K, entries []cache.Entry[V]) error