Crate indexbus_platform_config

Crate indexbus_platform_config 

Source
Expand description

Configuration conventions for IndexBus applications.

indexbus-platform-config is a platform layer (std-first) intended to be used alongside indexbus-kit.

What this crate provides

  • A small key/value loader for KEY=VALUE files and environment variables.
  • Explicit, documented precedence rules for layering sources.
  • Minimal error types intended for logging and user-facing diagnostics.

Feature requirements

  • std (required): this crate currently depends on filesystem and environment access.

Contracts

  • Layering is explicit and deterministic: later sources override earlier sources by key.
  • Environment variable keys are optionally normalized to support nested keys (see kv).
  • This crate intentionally does not implement a schema system; applications own their schema and validation.

§Example

use indexbus_platform_config::config::ConfigStack;
use indexbus_platform_config::kv::ConfigMap;

let defaults: ConfigMap = [("http.port".to_string(), "8080".to_string())]
    .into_iter()
    .collect();

let stack = ConfigStack::new()
    .with_defaults()
    .with_file_path("./app.env")
    .with_env_prefix("APP_");

let merged = stack.load_kv_map(defaults)?;

Modules§

config
High-level configuration conventions and layering. High-level configuration conventions.
errors
Error types and Result aliases. Error types and Result aliases.
kv
Minimal KEY=VALUE configuration loader. Simple key/value configuration loader.
prelude
Common re-exports for consumers of this crate. Curated prelude for platform config.