tengen-io / server

:white_circle: Server implementation of the board game Go
MIT License
13 stars 4 forks source link

refactor config, inject config into structs #33

Closed eaceaser closed 5 years ago

eaceaser commented 5 years ago

This unifies all the configuration into main.go, which is preferable to having GetEnv calls everywhere; this lets us change configuration easier.

This also starts to wire dependencies into structs at instantiation time, vs. having structs handle their own dependencies. I'll have another PR after this one that continues that.

The end goal is that the code here will be much more flexible and easier to extend with new features.

note: this will break the env vars being used in the production deploy, but I'm not sure how those are being wired up, but I'll want to pick your brain on how you are currently deploying this