omega-gamers / ohms-discord-bot

The official bot of the omega gamers
0 stars 0 forks source link

Add Support of Config Watching #6

Open sethicis opened 6 years ago

sethicis commented 6 years ago

Description

Currently the config file is only processed once, during init, but there are some config values that we may want to change without stopping the app. Debug, for one, comes to mind. This feature will mean that we can dynamically enable or disable features without needing to halt Ohms.

Implementation Details

Currently our configs are driven by a JSON file that gets unmarshalled into a Configuration struct. We'll need to switch over to parsing a JSON or yaml file using the viper library. I chose Viper, because it includes the ability to dynamically load config changes to a running app. Viper Go Configuration Library: https://github.com/spf13/viper