pub struct Config {
pub default_enterprise: Option<String>,
pub default_cloud: Option<String>,
pub default_database: Option<String>,
pub files_api_key: Option<String>,
pub profiles: HashMap<String, Profile>,
}Expand description
Main configuration structure
Fields§
§default_enterprise: Option<String>Default profile for enterprise commands
default_cloud: Option<String>Default profile for cloud commands
default_database: Option<String>Default profile for database commands
files_api_key: Option<String>Global Files.com API key for support package uploads Can be overridden per-profile. Supports keyring: prefix for secure storage.
profiles: HashMap<String, Profile>Map of profile name -> profile configuration
Implementations§
Source§impl Config
impl Config
Sourcepub fn find_first_profile_of_type(
&self,
deployment_type: DeploymentType,
) -> Option<&str>
pub fn find_first_profile_of_type( &self, deployment_type: DeploymentType, ) -> Option<&str>
Get the first profile of the specified deployment type (sorted alphabetically by name)
Sourcepub fn get_profiles_of_type(&self, deployment_type: DeploymentType) -> Vec<&str>
pub fn get_profiles_of_type(&self, deployment_type: DeploymentType) -> Vec<&str>
Get all profiles of the specified deployment type
Sourcepub fn resolve_enterprise_profile(
&self,
explicit_profile: Option<&str>,
) -> Result<String>
pub fn resolve_enterprise_profile( &self, explicit_profile: Option<&str>, ) -> Result<String>
Resolve the profile to use for enterprise commands
Sourcepub fn resolve_cloud_profile(
&self,
explicit_profile: Option<&str>,
) -> Result<String>
pub fn resolve_cloud_profile( &self, explicit_profile: Option<&str>, ) -> Result<String>
Resolve the profile to use for cloud commands
Sourcepub fn resolve_database_profile(
&self,
explicit_profile: Option<&str>,
) -> Result<String>
pub fn resolve_database_profile( &self, explicit_profile: Option<&str>, ) -> Result<String>
Resolve the profile to use for database commands
Sourcepub fn load_from_path(config_path: &Path) -> Result<Self>
pub fn load_from_path(config_path: &Path) -> Result<Self>
Load configuration from a specific path
Sourcepub fn save_to_path(&self, config_path: &Path) -> Result<()>
pub fn save_to_path(&self, config_path: &Path) -> Result<()>
Save configuration to a specific path
Sourcepub fn set_profile(&mut self, name: String, profile: Profile)
pub fn set_profile(&mut self, name: String, profile: Profile)
Set or update a profile
Sourcepub fn remove_profile(&mut self, name: &str) -> Option<Profile>
pub fn remove_profile(&mut self, name: &str) -> Option<Profile>
Remove a profile by name
Sourcepub fn list_profiles(&self) -> Vec<(&String, &Profile)>
pub fn list_profiles(&self) -> Vec<(&String, &Profile)>
List all profiles sorted by name
Sourcepub fn config_path() -> Result<PathBuf>
pub fn config_path() -> Result<PathBuf>
Get the path to the configuration file
On macOS, this supports both the standard macOS path and Linux-style ~/.config path:
- Check ~/.config/redisctl/config.toml (Linux-style, preferred for consistency)
- Fall back to ~/Library/Application Support/com.redis.redisctl/config.toml (macOS standard)
On Linux: ~/.config/redisctl/config.toml On Windows: %APPDATA%\redis\redisctl\config.toml