Versions in this module Expand all Collapse all v0 v0.1.0 Aug 15, 2026 Changes in this version + type Cache struct + func New[K comparable, V any](capacity int, opts ...Option) (*Cache[K, V], error) + func (c *Cache[K, V]) Clear(ctx context.Context) error + func (c *Cache[K, V]) Close() error + func (c *Cache[K, V]) Contains(key K) bool + func (c *Cache[K, V]) Delete(ctx context.Context, key K) error + func (c *Cache[K, V]) Exists(ctx context.Context, key K) (bool, error) + func (c *Cache[K, V]) Get(ctx context.Context, key K) (V, error) + func (c *Cache[K, V]) Len() int + func (c *Cache[K, V]) Set(ctx context.Context, key K, value V, ttl time.Duration) error + type Option func(*config) + func WithCleanupInterval(d time.Duration) Option + func WithDefaultTTL(ttl time.Duration) Option + func WithPrefix(prefix string) Option