Expand description
Configuration gear for toolkit-bootstrap
This gear provides configuration types and utilities for both host and OoP gears.
Structs§
- AppConfig
- Main application configuration with strongly-typed global sections and a flexible per-gear configuration bag.
- CliArgs
- Command line arguments structure.
- DbConn
Config - Reusable DB connection config for both global servers and gears. DSN must be a FULL, valid DSN if provided (dsn crate compliant).
- Execution
Config - Execution configuration for out-of-process gears.
- Gear
Config - Small typed view to parse each gear entry.
- Gear
Runtime - Runtime configuration for a gear (local vs out-of-process).
- Global
Database Config - Global database configuration with server-based DBs.
- PoolCfg
- Rendered
DbConfig - Rendered database configuration for
OoPgears. Contains both global server templates and gear-specific config. - Rendered
Gear Config - Rendered gear configuration passed to
OoPgears via environment variable. - Section
- Section
File - Server
Config
Enums§
- Console
Format - Console output format for the logging layer.
- Runtime
Kind - Gear runtime kind.
- Vendor
Config Error - Error type for vendor configuration access.
Constants§
- TOOLKIT_
MODULE_ CONFIG_ ENV - Environment variable name for passing rendered gear config to
OoPgears.
Functions§
- build_
final_ db_ for_ gear - Merges global + gear DB configs into a final, validated DSN and pool config.
Precedence: Global DSN -> Global fields -> Gear DSN -> Gear fields (fields always win).
For server-based, returns error if final dbname is missing.
For
SQLite, builds/normalizes sqlite DSN from file/path or uses a full DSN as-is. - default_
logging_ config - Create a default logging configuration.
- dump_
effective_ gears_ config_ json - Dump effective gears configuration as JSON string.
- dump_
effective_ gears_ config_ yaml - Dump effective gears configuration as YAML string.
- expand_
env_ in_ dsn - Expands environment variables in a DSN string.
Replaces
${VARNAME}with the actual environment variable value. - gear_
home - Helper function to resolve gear home directory.
Returns the path where gear-specific files (like
SQLitedatabases) should be stored. - get_
gear_ db_ config - Helper function to get gear database configuration from
AppConfig. Returns theDbConnConfigfor a gear, or None if the gear has no database config. - get_
gear_ runtime_ config - Helper to get runtime config for a gear (if present).
- list_
gear_ names - List all gear names present in the configuration.
- parse_
gear_ config - Parse a gear config from the config bag.
- redact_
dsn_ password - Redacts password from a DSN for safe logging.
- render_
effective_ gears_ config - Render effective configuration for all loaded gears.
- render_
gear_ config_ for_ oop - Render gear configuration for passing to
OoPgear via environment variable. - resolve_
password - Resolves password: if it contains ${VAR}, expands from environment variable; otherwise returns as-is.
- validate_
dsn - Validates that a DSN string is parseable by the dsn crate.
Note:
SQLiteDSNs have special formats that dsn crate doesn’t recognize, so we skip validation for them.
Type Aliases§
- Logging
Config - Logging configuration - maps subsystem names to their logging settings. Key “default” is the catch-all for logs that don’t match explicit subsystems.
- Vendor
Config - Per-vendor configuration bag: vendor name → arbitrary JSON/YAML value.
Each vendor’s section can be deserialized into a typed struct via
AppConfig::vendor_configorAppConfig::vendor_config_or_default.