How to read configuration from string or map?
ieugen opened this issue · 1 comments
ieugen commented
Hello,
I saw that aero reads directly from a file but I would like to read from a string or build a configuration from a user provided map.
The use case is to integrate it with https://github.com/l3nz/cli-matic that already has file reading capabilities.
Another use case would be to build a configuration dynamically (from a db or user input).
All the examples show reading from file and I'm quite new to clojure so I can't really tell how easy it is to do that from the sources.
Thanks,
SevereOverfl0w commented
Aero accepts a reader, so you can use a StringReader, see https://github.com/juxt/aero/blob/master/test/aero/core_test.cljc#L25 and https://github.com/juxt/aero/blob/master/test/aero/core_test.cljc#L217-L230