Documentation
¶
Overview ¶
Package cache is the caching module for Gas apps. Its backends implement the core's gas.CacheProvider (Get, Set, Delete, Exists over []byte values with a TTL), so services depend on that interface and the backend is chosen where the app is wired. The backends live in sub-packages: memory keeps entries in process, and valkey talks to a Valkey or other Redis-compatible server. cachetest provides a recording mock of gas.CacheProvider.
This package holds what the backends share: the sentinel errors ErrKeyNotFound, returned by Get for a key that is missing or expired, and ErrClosed, returned by every operation on a backend that has not started or has been stopped.
See the module README for usage examples and design rationale.
SPDX-License-Identifier: MIT
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrKeyNotFound is returned by Get when the requested key does not // exist or has expired. ErrKeyNotFound = errors.New("cache: key not found") // ErrClosed is returned when an operation is attempted on a cache // service that has not been started or has been closed. ErrClosed = errors.New("cache: service is closed") )
Sentinel errors returned by CacheProvider implementations.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cachetest provides a mock implementation of gas.CacheProvider for use in tests.
|
Package cachetest provides a mock implementation of gas.CacheProvider for use in tests. |
|
Package memory is the in-process gas.CacheProvider backend.
|
Package memory is the in-process gas.CacheProvider backend. |
|
Package valkey is the gas.CacheProvider backend for a Valkey or other Redis-compatible server, built on the valkey-go client.
|
Package valkey is the gas.CacheProvider backend for a Valkey or other Redis-compatible server, built on the valkey-go client. |