Versions in this module Expand all Collapse all v4 v4.2.0 Jul 5, 2026 v4.1.1 Jul 5, 2026 v4.1.0 Jul 5, 2026 v4.0.1 Jun 29, 2026 v4.0.0 Jun 29, 2026 Changes in this version + func MutateAsync[T any](parseC *Cache, parseKey string, parseOptimistic T, parseFn func() (T, error), ...) + type Cache struct + func New(parseOpts ...Option) *Cache + func (parseC *Cache) Inspect() []EntryInfo + func (parseC *Cache) Invalidate(parseKey string) + func (parseC *Cache) InvalidateAll() + func (parseC *Cache) InvalidatePrefix(parsePrefix string) + func (parseC *Cache) Keys() []string + func (parseC *Cache) Peek(parseKey string) (any, bool) + func (parseC *Cache) Set(parseKey string, parseData any) + type EntryInfo struct + Fetching bool + HasData bool + Key string + Stale bool + UpdatedAt time.Time + type Option func(*Cache) + func WithClock(parseNow func() time.Time) Option + func WithStaleTime(parseD time.Duration) Option + type Result struct + Data T + Err error + Fetching bool + Stale bool + Status Status + UpdatedAt time.Time + func Fetch[T any](parseC *Cache, parseKey string, parseFn func() (T, error)) Result[T] + func Mutate[T any](parseC *Cache, parseKey string, parseOptimistic T, parseFn func() (T, error)) Result[T] + func SWR[T any](parseC *Cache, parseKey string, parseFn func() (T, error), ...) Result[T] + func Snapshot[T any](parseC *Cache, parseKey string) Result[T] + type Status int + const StatusError + const StatusIdle + const StatusLoading + const StatusSuccess + func (parseS Status) String() string