Fork me on GitHub
#duct
<
2021-07-02
>
Daniel19:07:41

Hey guys, what’s the best way to avoid specifying a common set of configuration keys for several modules:

:foobar/module1
{:api_password #duct/env "API_PASSWORD"
 :user_id #duct/env "USER_ID"}

:foobar/module2
{:api_password #duct/env "API_PASSWORD"
 :user_id #duct/env "USER_ID"}

:foobar/module3
{:api_password #duct/env "API_PASSWORD"
 :user_id #duct/env "USER_ID"}

Kevin19:07:14

Something like this maybe?

{[:duct/const :my/stuff]
{,,,}}
And then ref :my/stuff

Daniel19:07:44

Okay, so then :my/stuff is an empty module then

Kevin19:07:49

Your password / user won't be flattened in the opts though

Daniel19:07:10

Yeah, I guess I need to flatten that into opts using a function

Kevin19:07:13

It's derives from duct/const, so it just returns the opts

Daniel19:07:41

Cool thanks

👍 3