Versions in this module Expand all Collapse all v0 v0.6.1 Nov 14, 2026 Changes in this version + var ErrNotFound = errors.New("cache: key not found") + type Cache interface + Delete func(ctx context.Context, key string) error + Get func(ctx context.Context, key string) (*Entry, error) + Set func(ctx context.Context, key string, data []byte, opts ...SetOption) error + type Entry struct + Data []byte + Expiration time.Time + func (e *Entry) Expired() bool + func (e *Entry) TTL() time.Duration + type SetOption func(opts *SetOptions) + func WithTTL(d time.Duration) SetOption + type SetOptions struct + TTL time.Duration