| Crates.io | xvc-config |
| lib.rs | xvc-config |
| version | 0.6.17 |
| created_at | 2022-10-18 10:05:36.97151+00 |
| updated_at | 2025-04-22 14:51:41.047529+00 |
| description | Xvc configuration management |
| homepage | https://xvc.dev |
| repository | https://github.com/iesahin/xvc |
| max_upload_size | |
| id | 690762 |
| size | 57,342 |
The xvc-config crate provides a general solution for maintaining configuration settings across different sources with cascading precedence. It is part of the Xvc project, a version control system focused on data and MLOps.
This crate provides a flexible configuration system that can load and merge settings from multiple sources:
Configuration values are cascaded and overridden according to precedence, with command line options having the highest priority.
group.subgroup.key)Here are examples showing how to use the xvc-config crate in various scenarios:
use std::path::PathBuf;
use xvc_config::{XvcConfigParams, XvcConfig};
use xvc_walker::AbsolutePath;
// Create custom configuration parameters
let params = XvcConfigParams {
// Set the current directory
current_dir: AbsolutePath::from(std::env::current_dir().unwrap()),
// Set default configuration
default_configuration: r#"
[core]
guid = ""
verbosity = "info"
[storage]
type = "local"
path = "./data"
"#.to_string(),
// Include standard config locations
include_system_config: true,
include_user_config: true,
include_environment_config: true,
// Specify custom paths
project_config_path: Some(PathBuf::from("./xvc.toml")),
local_config_path: Some(PathBuf::from("./xvc.local.toml")),
// Override with command line options
command_line_config: Some(vec![
"core.verbosity=debug".to_string(),
"storage.path=./custom-data".to_string(),
]),
};
// Create config from parameters
let config = XvcConfig::new(params).expect("Failed to create config");