Open j-n-f opened 4 weeks ago
I've settled on https://github.com/rust-cli/config-rs
config-rs turned out to be insufficient for my needs.
I tried figment, but it also has some UX issues where the errors aren't as helpful as I'd hoped (e.g. errors need to be picked away one by one because serde finishes parsing on the first error): https://github.com/SergioBenitez/Figment/issues/131
Options:
Deserialize
trait to save a bit of workAnother contender: https://github.com/greyblake/envconfig-rs
Supports nesting. I like the simplicity. Remains to be seen how it handles multiple errors.
I could imagine a simple PR to support listing all configs possible by making a few small changes to the derive macro.
Maybe I can just build my own version of something like envconfig-rs
and be done with it. I like the approach (where anything that implements FromStr
will just work, without having to fuss with the complexity of serde
).
After a lot of headaches trying to get the perfect solution, it looks like the best approach is:
app key is currently hardcoded.