pub struct ValkeyConfig {
pub endpoint: String,
pub tls: bool,
pub username: Option<String>,
pub password: Option<String>,
pub key_prefix: String,
pub ttl_seconds: Option<u64>,
pub max_session_lifetime_seconds: Option<u64>,
pub connect_timeout_ms: u64,
pub command_timeout_ms: u64,
}Expand description
Parsed global.apl.session_store config for kind: valkey.
Unknown keys (including kind, consumed by the factory dispatch) are
ignored so the same block can carry the discriminator.
Fields§
§endpoint: StringEndpoint: a redis:// / rediss:// URL or a bare host:port.
tls: boolWhether to use TLS. Implied true for a rediss:// endpoint.
Required for any non-localhost endpoint (validated).
username: Option<String>Optional ACL username (Valkey 6+ ACLs). Paired with password.
password: Option<String>Optional auth password / ACL secret. Sourced from config/env by the operator; never hard-coded.
key_prefix: StringKey prefix/namespace for label keys (R9).
ttl_seconds: Option<u64>Sliding TTL in seconds, refreshed on load and append. None
(default) means no expiry (R7).
max_session_lifetime_seconds: Option<u64>Declared maximum session-identity lifetime, used only to emit the
TTL-soundness warning (R17) when ttl_seconds is shorter.
connect_timeout_ms: u64Connection acquisition timeout (ms).
command_timeout_ms: u64Per-command response timeout (ms) — the fail-closed hot-path knob.
Implementations§
Source§impl ValkeyConfig
impl ValkeyConfig
Sourcepub fn from_value(value: &Value) -> Result<Self, BuildError>
pub fn from_value(value: &Value) -> Result<Self, BuildError>
Parse from the YAML config block, then validate.
Sourcepub fn tls_enabled(&self) -> bool
pub fn tls_enabled(&self) -> bool
TLS is on when explicitly set or implied by a rediss:// scheme.
Sourcepub fn connection_url(&self) -> Result<String, BuildError>
pub fn connection_url(&self) -> Result<String, BuildError>
Build the redis/rediss connection URL deadpool consumes.
Credentials are percent-encoded via the url crate (never naive
string interpolation), and the wire scheme always reflects
Self::tls_enabled so it cannot disagree with the validated TLS
intent. A fully-formed endpoint URL is parsed (and trusted for its
own embedded credentials); a bare host:port is assembled with
the configured scheme and any separate username/password.
Trait Implementations§
Source§impl Clone for ValkeyConfig
impl Clone for ValkeyConfig
Source§fn clone(&self) -> ValkeyConfig
fn clone(&self) -> ValkeyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more