Skip to main content

Crate ferrlabs_cache

Crate ferrlabs_cache 

Source
Expand description

Shared Valkey (Redis-compatible) connection pool for FerrLabs APIs.

Mirrors ferrlabs-db: config-from-env plus a connect factory that returns a fred pool that reconnects on its own. A server that is unreachable at startup does not fail connect: the pool keeps retrying in the background, and commands time out after one second in the meantime, so callers degrade instead of hanging. Misconfiguration (TLS, auth, URL) still fails connect. Consumers run commands against fred directly — it is re-exported here so they don’t take a separate fred dependency.

Re-exports§

pub use fred;

Structs§

CacheConfig
Debug is implemented by hand (see below) rather than derived, because both url and password can carry the AUTH secret — a derived Debug would print it in the clear via any {:?} or tracing::debug!(?config), defeating the entire point of keeping the password out of the logs. Do not replace it with #[derive(Debug)].
Swr

Functions§

connect

Type Aliases§

CachePool