| Crates.io | armature-cache |
| lib.rs | armature-cache |
| version | 0.1.1 |
| created_at | 2025-12-27 00:35:04.811185+00 |
| updated_at | 2025-12-30 22:27:31.501367+00 |
| description | Cache management for Armature framework with Redis and in-memory support |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006491 |
| size | 125,217 |
Cache management for the Armature framework.
[dependencies]
armature-cache = "0.1"
use armature_cache::{Cache, RedisCache};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Connect to Redis
let cache = RedisCache::new("redis://localhost:6379").await?;
// Set a value with TTL
cache.set("key", "value", Some(Duration::from_secs(300))).await?;
// Get a value
let value: Option<String> = cache.get("key").await?;
// Delete a value
cache.delete("key").await?;
Ok(())
}
let cache = RedisCache::new("redis://localhost:6379").await?;
let cache = MemoryCache::new();
MIT OR Apache-2.0