Documentation
¶
Overview ¶
Package errors defines shared sentinel errors and classifiers for cache drivers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrExpired = errors.New("cache: expired")
ErrExpired is returned when a cache entry exists but is expired.
Drivers may wrap this error; use IsExpiredError to classify this condition.
var ErrInvalidURL = errors.New("cache: invalid driver url")
ErrInvalidURL is returned when a cache backend URL cannot be parsed.
var ErrMissing = errors.New("cache: missing")
ErrMissing is returned when a cache entry does not exist.
Drivers may wrap this error; use IsMissingError to classify this condition.
var ErrNotFound = errors.New("cache: driver not found")
ErrNotFound is returned when the configured cache driver kind is unknown.
Functions ¶
func IsExpiredError ¶
IsExpiredError reports whether err represents an expired cache entry.
This helper exists so higher-level code can treat expired entries as cache misses regardless of the underlying backend implementation.
func IsMissingError ¶
IsMissingError reports whether err represents a missing cache entry.
This helper normalizes the miss semantics of the backends currently supported by this package, including Redis nil replies (github.com/redis/go-redis/v9.Nil).
Types ¶
This section is empty.