Comments (4)
I think @AlekSi might be trying to solve the problem of "What the heck actually got applied from the env vars I passed" because it can be challenging to figure out which were actually picked up. I wrote a thing which we use to solve that: https://github.com/relistan/rubberneck
Configure your app with envconfig, and then on startup have it dump the config it's running from to the logs. You could also do this from a CLI switch if needed. I find it useful. Maybe it solves this problem and it doesn't need to be solved in envconfig. You could alternatively dump a TOML or YAML file from your config struct if you don't like Rubberneck.
from envconfig.
This seems like a debugging use case? I can understand applications needing to:
- parse configuration from the environment
- print helpful output documenting supported environment vars and their types
I'm trying to wrap my head around the need for this or find precedent anywhere else. It would be like if someapp -t -a -N 2 -h
printed help output informing the user that they activated the "t" and "a" flags, and that the "N" value is 2.
from envconfig.
@relistan that package looks great! I agree it's not really the job of envconfig -- I'll be pointing people to rubberneck next time this comes up.
from envconfig.
Thanks @teepark!
from envconfig.
Related Issues (20)
- Feature Request: multiple names for fields HOT 4
- Support for map[string]interface{} HOT 1
- environment variable does not precede default envconfig value in struct HOT 1
- Add support for getting a FlagSet from envconfig HOT 1
- Possible to populate fields discretely for a slice of structs? HOT 4
- Syntax for map of structs or other maps HOT 1
- envconfig does not reach nested structs HOT 3
- Feature Request: Ability to get list of ENV variables HOT 2
- Var not found after being exported HOT 1
- Maps configuration with value including colon character HOT 3
- Incorrectly reading long strings HOT 1
- time.Duration support for days notation
- Support a second API func to control environments source
- Set `split_words` as a global option HOT 4
- support optional trim
- Error message from required field should include prefix if specified. HOT 1
- Required by default
- Support for conditional requirement of variables
- Is this project still maintained? HOT 5
- Feature Request: Make usage available in machine processable format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from envconfig.