refactor: move default viper config values to commands/commands.go

This commit is contained in:
Jordan Knott
2020-10-20 18:52:09 -05:00
parent 86f2d90668
commit 6c7203a4aa
4 changed files with 9 additions and 19 deletions

View File

@ -66,6 +66,15 @@ func initConfig() {
// Execute the root cobra command
func Execute() {
viper.SetDefault("server.hostname", "0.0.0.0:3333")
viper.SetDefault("database.host", "127.0.0.1")
viper.SetDefault("database.name", "taskcafe")
viper.SetDefault("database.user", "taskcafe")
viper.SetDefault("database.password", "taskcafe_test")
viper.SetDefault("queue.broker", "amqp://guest:guest@localhost:5672/")
viper.SetDefault("queue.store", "memcache://localhost:11211")
rootCmd.SetVersionTemplate(versionTemplate)
rootCmd.AddCommand(newWebCmd(), newMigrateCmd(), newTokenCmd(), newWorkerCmd(), newResetPasswordCmd())
rootCmd.Execute()