duct

Daniel 2021-07-02T19:53:41.020500Z

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

kwrooijen 2021-07-02T19:56:14.022800Z

Something like this maybe?

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

Daniel 2021-07-02T19:56:44.023700Z

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

kwrooijen 2021-07-02T19:56:49.023900Z

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

Daniel 2021-07-02T19:57:10.024700Z

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

kwrooijen 2021-07-02T19:57:13.024900Z

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

Daniel 2021-07-02T19:57:41.025300Z

Cool thanks

👍 1