redisctl_config/
lib.rs

1//! Configuration and profile management for Redis CLI tools
2//!
3//! This library provides a reusable configuration system for managing
4//! credentials and settings for Redis Cloud and Redis Enterprise deployments.
5//!
6//! # Features
7//!
8//! - Multiple named profiles for different Redis deployments
9//! - Secure credential storage using OS keyring (optional)
10//! - Environment variable expansion in config files
11//! - Platform-specific config file locations
12//! - Support for both Redis Cloud and Redis Enterprise
13//!
14//! # Examples
15//!
16//! ## Loading Configuration
17//!
18//! ```no_run
19//! use redisctl_config::Config;
20//!
21//! let config = Config::load()?;
22//! # Ok::<(), redisctl_config::ConfigError>(())
23//! ```
24//!
25//! ## Creating a Profile
26//!
27//! ```
28//! use redisctl_config::{Config, Profile, DeploymentType, ProfileCredentials};
29//!
30//! let profile = Profile {
31//!     deployment_type: DeploymentType::Cloud,
32//!     credentials: ProfileCredentials::Cloud {
33//!         api_key: "your-api-key".to_string(),
34//!         api_secret: "your-secret".to_string(),
35//!         api_url: "https://api.redislabs.com/v1".to_string(),
36//!     },
37//!     files_api_key: None,
38//!     resilience: None,
39//! };
40//!
41//! let mut config = Config::default();
42//! config.set_profile("production".to_string(), profile);
43//! ```
44
45pub mod config;
46pub mod credential;
47pub mod error;
48pub mod resilience;
49
50// Re-export main types for convenience
51pub use config::{Config, DeploymentType, Profile, ProfileCredentials};
52pub use credential::{CredentialStorage, CredentialStore};
53pub use error::{ConfigError, Result};
54pub use resilience::ResilienceConfig;