errors

package
v2.679.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errors defines shared sentinel errors and classifiers for cache drivers.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var ErrInvalidURL = errors.New("cache: invalid driver url")

ErrInvalidURL is returned when a cache backend URL cannot be parsed.

View Source
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.

View Source
var ErrNotFound = errors.New("cache: driver not found")

ErrNotFound is returned when the configured cache driver kind is unknown.

Functions

func IsExpiredError

func IsExpiredError(err error) bool

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

func IsMissingError(err error) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL