Menu

Wire it, don't configure it
📰

Wire it, don't configure it

DEV Community: go·Matt Cockayne·3 days ago
#pU549Mqi
#devtogo#devto#dev#config#tool
Reading 0:00
15s threshold

Where does a tool's configuration live? For a tool generated by go-tool-base it's always been a file you point it at with --config , and for plenty of tools that's all they'll ever need. But configuration has a habit of getting more involved depending on where a thing is run. One team keeps shared settings in Consul, another keeps secrets in Vault, a third has everything in AWS Parameter Store, and some platform or other drops a .env file in /etc and expects you to read it.

The estate has adapters for all of that, twenty-six of them in the go/config family (it's a big family). And until recently a generated project couldn't reach any of them.

Two awkward facts

When I came to bring them into the generator, the brief I gave the session was to work out how the adapters would manifest in a generated project "safely and most importantly securely". Two facts got in the way, and the spec ( 0204 ) put them plainly.

The first is that most of these adapters need a client the framework can't build for you.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.