name: add-config-option description: Add a new configuration option to tedge_config. Use when adding a new setting to the thin-edge.io configuration in tedge.toml.
Add Configuration Option
Steps
- Add field to
define_tedge_config!macro incrates/common/tedge_config/src/tedge_toml/tedge_config.rs - Choose appropriate type:
String— free-form textAbsolutePath— filesystem pathConnectUrl— URL with schemeSecondsOrHumanTime— duration (e.g.,30s,5m)- Custom types in
crates/common/tedge_config/src/tedge_toml/models/
- Add
#[tedge_config()]attributes:default(value = "...")— default valueexample = "..."— example for documentationreader(...)— custom reader function- Other modifiers as needed
- Add doc comment above the field — this becomes user-facing help text in
tedge config - For custom types, add to
crates/common/tedge_config/src/tedge_toml/models/ - Verify: Run
cargo test -p tedge_config
Reference Files
Read these for patterns:
crates/common/tedge_config/src/tedge_toml/tedge_config.rs— thedefine_tedge_config!invocation with all existing optionscrates/common/tedge_config/src/tedge_toml/models/— custom configuration types