You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example in the bud documentation uses github.com/caarlos0/env/v6 to show a way to do env, but if leaning on this library is a problem then bud could implement a similar API. Either way, the following is what I propose that bud do:
Users can specify these config structs as dependencies of controllers, etc. If they do, bud satisfies the dependencies according to its normal DI system with the following two additions:
Bud calls env.Parse(e) if using "github.com/caarlos0/env/v6", or some similar thing to inject any OS environment values into the config objects (prior to adding them to the controller)
Let me know if this seems correct and/or feasible.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm curious how the following idea of environment and configuration comports with yours.
Users define structs called
<Something>Config
inconfig/
like so:This example in the bud documentation uses github.com/caarlos0/env/v6 to show a way to do env, but if leaning on this library is a problem then bud could implement a similar API. Either way, the following is what I propose that bud do:
Users can specify these config structs as dependencies of controllers, etc. If they do, bud satisfies the dependencies according to its normal DI system with the following two additions:
.env
file is read into the OS environment using github.com/joho/godotenv.env.Parse(e)
if using "github.com/caarlos0/env/v6", or some similar thing to inject any OS environment values into the config objects (prior to adding them to the controller)Let me know if this seems correct and/or feasible.
Beta Was this translation helpful? Give feedback.
All reactions