Something went wrong. Try again.
QuickDID is a high-performance AT Protocol identity resolution service written in Rust. It provides handle-to-DID resolution with Redis-back
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132//! Redis cache utilities for QuickDID
use deadpool_redis::{Config, Pool, Runtime};use thiserror::Error;
/// Cache-specific errors#[derive(Debug, Error)]pub enum CacheError { /// Redis pool creation failed #[error("error-quickdid-cache-1 Redis pool creation failed: {0}")] RedisPoolCreationFailed(String),}
/// Create a Redis connection pool from a Redis URL.////// # Arguments////// * `redis_url` - Redis connection URL (e.g., "redis://localhost:6379/0")////// # Errors////// Returns an error if:/// - The Redis URL is invalid/// - Pool creation failspub fn create_redis_pool(redis_url: &str) -> Result<Pool, CacheError> { let config = Config::from_url(redis_url); let pool = config .create_pool(Some(Runtime::Tokio1)) .map_err(|e| CacheError::RedisPoolCreationFailed(e.to_string()))?; Ok(pool)}