pub struct CachekitConfig {
pub api_key: Option<Zeroizing<String>>,
pub api_url: String,
pub master_key: Option<Zeroizing<Vec<u8>>>,
pub default_ttl: Duration,
pub namespace: Option<String>,
pub l1_capacity: usize,
pub max_payload_bytes: usize,
}Expand description
Runtime configuration for a crate::client::CacheKit instance.
Fields§
§api_key: Option<Zeroizing<String>>API key for cachekit.io authentication.
api_url: StringBase URL of the cachekit.io API.
master_key: Option<Zeroizing<Vec<u8>>>Master key used for zero-knowledge encryption (AES-256-GCM).
default_ttl: DurationDefault TTL for cache entries when none is specified at call site.
namespace: Option<String>Optional namespace prefix applied to all cache keys.
l1_capacity: usizeMaximum number of entries in the L1 in-process cache.
max_payload_bytes: usizeMaximum allowed payload size in bytes. Larger payloads are rejected.
Implementations§
Source§impl CachekitConfig
impl CachekitConfig
Sourcepub fn from_env() -> Result<Self, CachekitError>
pub fn from_env() -> Result<Self, CachekitError>
Build configuration from environment variables.
| Variable | Description |
|---|---|
CACHEKIT_API_KEY | API key for cachekit.io |
CACHEKIT_API_URL | Override API base URL (must be HTTPS) |
CACHEKIT_MASTER_KEY | Hex-encoded master key (min 32 bytes) |
CACHEKIT_DEFAULT_TTL | Default TTL in seconds (min 1) |
Trait Implementations§
Source§impl Debug for CachekitConfig
impl Debug for CachekitConfig
Auto Trait Implementations§
impl Freeze for CachekitConfig
impl RefUnwindSafe for CachekitConfig
impl Send for CachekitConfig
impl Sync for CachekitConfig
impl Unpin for CachekitConfig
impl UnsafeUnpin for CachekitConfig
impl UnwindSafe for CachekitConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more