Versions in this module Expand all Collapse all v0 v0.1.0 Jun 19, 2026 Changes in this version + type Cache interface + Del func(key string) + Get func(key string) (T, bool) + Len func() int + Purge func() + Set func(key string, v T) + SetTTL func(key string, v T, ttl time.Duration) + Stats func() cache.Stats + type Option func(*config) + func WithCapacity(n int) Option + func WithClock(now func() time.Time) Option + func WithDefaultTTL(d time.Duration) Option + func WithOnEvict[T any](fn func(key string, v T, cause cache.EvictionCause)) Option + func WithSweepInterval(d time.Duration) Option + type Store struct + func New[T any](opts ...Option) *Store[T] + func (s *Store[T]) Close() + func (s *Store[T]) Del(key string) + func (s *Store[T]) Get(key string) (T, bool) + func (s *Store[T]) Len() int + func (s *Store[T]) Purge() + func (s *Store[T]) Remember(key string, ttl time.Duration, fn func() (T, error)) (T, error) + func (s *Store[T]) Set(key string, v T) + func (s *Store[T]) SetTTL(key string, v T, ttl time.Duration) + func (s *Store[T]) Stats() cache.Stats