duct 2021-07-02

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"}

Something like this maybe?

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

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

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

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

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

Cool thanks

👍 1