- Migrate individual modules to independent crates - Refactor dependencies for improved modularity - Update build system and testing infrastructure - Update documentation to reflect new structure
40 lines
1.2 KiB
Rust
40 lines
1.2 KiB
Rust
//! SAL Redis Client
|
|
//!
|
|
//! A robust Redis client wrapper for Rust applications that provides connection management,
|
|
//! automatic reconnection, and a simple interface for executing Redis commands.
|
|
//!
|
|
//! ## Features
|
|
//!
|
|
//! - **Connection Management**: Automatic connection handling with lazy initialization
|
|
//! - **Reconnection**: Automatic reconnection on connection failures
|
|
//! - **Builder Pattern**: Flexible configuration with authentication support
|
|
//! - **Environment Configuration**: Support for environment variables
|
|
//! - **Thread Safety**: Safe to use in multi-threaded applications
|
|
//! - **Rhai Integration**: Scripting support for Redis operations
|
|
//!
|
|
//! ## Usage
|
|
//!
|
|
//! ```rust
|
|
//! use sal_redisclient::{execute, get_redis_client};
|
|
//! use redis::cmd;
|
|
//!
|
|
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
//! // Execute a simple SET command
|
|
//! let mut set_cmd = redis::cmd("SET");
|
|
//! set_cmd.arg("my_key").arg("my_value");
|
|
//! let result: redis::RedisResult<()> = execute(&mut set_cmd);
|
|
//!
|
|
//! // Get the Redis client directly
|
|
//! let client = get_redis_client()?;
|
|
//! # Ok(())
|
|
//! # }
|
|
//! ```
|
|
|
|
mod redisclient;
|
|
|
|
pub use redisclient::*;
|
|
|
|
// Rhai integration module
|
|
#[cfg(feature = "rhai")]
|
|
pub mod rhai;
|