thin-edge.io
thin-edge.io copied to clipboard
Ability to derive config settings derived from another setting
Is your feature improvement request related to a problem? Please describe.
For certain config settings, it'd be good if they can be defined relative to another setting. For example, when we have the data.path
setting and would like to add another directory setting that is a sub-directory of the data.path
, it would be nice if we can specify that dependency relationship in the config definition itself.
Describe the solution you'd like
state: {
/// The directory used to store data like cached files, runtime metadata, etc.
#[tedge_config(from(prefix = "data.path", value = "mapper_state"))]
#[doku(as = "PathBuf")]
path: Utf8PathBuf,
},
If the data.path
is pointing to /var/tedge
, the above setting will point to the subdirectory: /var/tedge/mapper_state
.