Expand description
Configuration and settings for Genja Core.
This module defines the configuration structs that drive Genja behavior, plus helpers for loading from config files and environment variables.
Key points
- All configs implement
Defaultand can be created with::default(). - Builders allow partial configuration; missing fields are filled with defaults.
Settings::from_fileloads JSON or YAML and validates SSH config when present.
§Configuration Precedence
- Configuration files (JSON/YAML) are loaded first
- Environment variables provide defaults for missing fields
- Hard-coded defaults are used as final fallback
§Environment Variables
The following environment variables are supported:
GENJA_CORE_RAISE_ON_ERROR- Controls error handling behavior (default: false)GENJA_INVENTORY_PLUGIN- Inventory plugin name (default: “FileInventoryPlugin”)GENJA_RUNNER_PLUGIN- Runner plugin name (default: “threaded”)GENJA_LOGGING_LEVEL- Log level (default: “info”)GENJA_LOGGING_LOG_FILE- Log file path (default: “genja.log”)GENJA_LOGGING_TO_CONSOLE- Enable console logging (default: false)
§Settings Reference
See docs/settings.md for a complete schema summary and example config files.
§Examples
§Defaults
use genja_core::Settings;
let settings = Settings::default();§Builders
use genja_core::Settings;
use genja_core::settings::{LoggingConfig, RunnerConfig};
let settings = Settings::builder()
.logging(LoggingConfig::builder().level("debug").build())
.runner(RunnerConfig::builder().plugin("threaded").build())
.build();§Load From File
use genja_core::Settings;
let settings = Settings::from_file("config.yaml")?;§SSH Validation
SSH config is validated automatically when calling Settings::from_file.
For manual validation, use SSHConfig::validate.
Structs§
- Core
Config - Core runtime behavior settings.
- Core
Config Builder - Builder for
CoreConfig. - Inventory
Config - Inventory loader configuration.
- Inventory
Config Builder - Builder for
InventoryConfig. - Logging
Config - Logging settings consumed by applications embedding Genja.
- Logging
Config Builder - Builder for
LoggingConfig. - Options
Config - Optional file paths for hosts, groups, and defaults inventory sources.
- Options
Config Builder - Builder for
OptionsConfig. - Runner
Config - Task runner configuration.
- Runner
Config Builder - Builder for
RunnerConfig. - SSHConfig
- SSH client settings.
- SSHConfig
Builder - Builder for
SSHConfig. - Settings
- Top-level Genja configuration.
- Settings
Builder - Builder for
Settings.