mehcode / config-rs

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Apache License 2.0
2.43k stars 206 forks source link

feature request: Get interpolated values #377

Closed angelorendina closed 8 months ago

angelorendina commented 1 year ago

I have looked at the examples and the documentation but could not find anything - I suspect this is not supported at the moment(?).

Use case is:

I want to source from both the TOML file and the environment, and .get("foo") to interpolate to hello world. Thanks in advance if you have a solution for this, or if you could confirm it's not possible currently!

matthiasbeyer commented 1 year ago

Hi! Yes this is currently not supported and I would even say that it might not be in the near future. Maybe you can roll your own solution for this. I am personally rather fond of the "handlebars" crate for interpolation, maybe that fits your needs.

polarathene commented 8 months ago

Advice is to use a templating language and provide your ENV/vars as input that you can handle manually after config generation, or create a custom format/source for.

If someone wants to contribute that as a feature, they are welcome to open a PR.


Closing as niche request with minimal activity and interest expressed since.