use std::time::Duration;

/// Cache configuration shared by cache backends.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CacheConfig {
    /// Key namespace prefix.
    pub namespace: String,
    /// Default entry time-to-live.
    pub default_ttl: Duration,
}

impl Default for CacheConfig {
    fn default() -> Self {
        Self {
            namespace: "rs-zero".to_string(),
            default_ttl: Duration::from_secs(300),
        }
    }
}
