| | |
| | | Color string `mapstructure: "color"` |
| | | } |
| | | type server struct { |
| | | ServerName string `mapstructure: "serverName"` |
| | | Runmode string `mapstructure: "runmode"` |
| | | JwtSecret string `mapstructure: "jwtSecret"` |
| | | JwtExpire string `mapstructure: "jwtExpire"` |
| | |
| | | |
| | | var FaceDetectSet = &facedetect{} |
| | | |
| | | type shop struct { |
| | | Url string `mapstructure:"url"` |
| | | } |
| | | var ShopConf = &shop{} |
| | | |
| | | // Init is an exported method that takes the environment starts the viper |
| | | // (external lib) and returns the configuration struct. |
| | | func Init(env string) { |
| | | var err error |
| | | viper.SetConfigType("yaml") |
| | | viper.SetConfigName(env) |
| | | viper.AddConfigPath("/opt/vasystem/config/") |
| | | viper.AddConfigPath("../config/") |
| | | err = viper.ReadInConfig() |
| | | if err != nil { |
| | | log.Fatal("error on parsing configuration file", err) |
| | |
| | | viper.UnmarshalKey("dbpersoncompare", DbPersonCompInfo) |
| | | viper.UnmarshalKey("espersoncompare", EsCompServerInfo) |
| | | viper.UnmarshalKey("elastic.basicFS", BasicFS) |
| | | viper.UnmarshalKey("shop", ShopConf) |
| | | } |