Initial commit

This commit is contained in:
simon987
2019-01-12 16:18:14 -05:00
commit 83276ce8b0
25 changed files with 1367 additions and 0 deletions

24
config/config.go Normal file
View File

@@ -0,0 +1,24 @@
package config
import (
"github.com/spf13/viper"
)
var Cfg struct {
ServerAddr string
DbConnStr string
}
func SetupConfig() {
viper.AddConfigPath(".")
viper.SetConfigName("")
err := viper.ReadInConfig()
if err != nil {
panic(err)
}
Cfg.ServerAddr = viper.GetString("server.address")
Cfg.DbConnStr = viper.GetString("database.conn_str")
}