armature-config

Crates.ioarmature-config
lib.rsarmature-config
version0.1.1
created_at2025-12-26 20:53:59.928147+00
updated_at2025-12-29 00:47:31.155871+00
descriptionConfiguration management for Armature with environment and file support
homepagehttps://pegasusheavy.github.io/armature
repositoryhttps://github.com/pegasusheavy/armature
max_upload_size
id2006231
size91,335
Joseph R. Quinn (quinnjr)

documentation

README

armature-config

Configuration management for the Armature framework.

Features

  • Multiple Sources - Environment, files, remote
  • File Formats - TOML, YAML, JSON
  • Type-Safe - Deserialize into typed structs
  • Hot Reload - Watch for config changes
  • Secrets - Vault, AWS Secrets Manager integration

Installation

[dependencies]
armature-config = "0.1"

Quick Start

use armature_config::{Config, Environment};
use serde::Deserialize;

#[derive(Deserialize)]
struct AppConfig {
    database_url: String,
    port: u16,
    debug: bool,
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config: AppConfig = Config::builder()
        .add_source(Environment::with_prefix("APP"))
        .add_source(File::with_name("config"))
        .build()?
        .try_deserialize()?;

    println!("Port: {}", config.port);
    Ok(())
}

Environment Variables

APP_DATABASE_URL=postgres://localhost/mydb
APP_PORT=3000
APP_DEBUG=true

Config Files

# config.toml
database_url = "postgres://localhost/mydb"
port = 3000
debug = true

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt