DEV Community

Discussion on: Fauda: configuration made simple

 
ngryman profile image
Nicolas Gryman • Edited

Thanks for the feedback!

I like the idea of having a fauda inspect. It could be a non-intrusive way to debug an already running Fauda-configured app.

I believe this could end up in unpredictable results though. The configuration file or the environment variables might have changed since the app has started, and fauda inspect could return values that don't reflect the startup app's configuration.

I think this could work if we enabled some communication between a Fauda-configured app and fauda inspect (e.g. socket). However, this would quickly add complexity to the current implementation. 😅

Do you see any other approaches that could allow fauda inspect to inspect an already running app?

Thread Thread
 
zomglings profile image
Neeraj Kashyap

You know, I need to retract my previous statement about Viper (github.com/spf13/viper). Used it this weekend to build a command line tool in Go, and I found it to be quite useful.

This is the tool: github.com/bugout-dev/bugout-go

When someone installs that tool, they get access to a bugout binary. They can initialize a config file using bugout state init. The approach I've taken to inspecting state is bugout state current. This shows the config file path as well as the current config key-value pairs.

It's nowhere near as comprehensive as what Fauda allows you to do, but it suggests a different approach than a live Fauda socket (which, as you rightly pointed out, is way too much complexity). Instead, you can just write (atomically) Fauda state into a tempfile and read the most recent state from that file on fauda inspect.