| | |
| | | Color string `mapstructure: "color"` |
| | | } |
| | | type server struct { |
| | | ServerName string `mapstructure: "serverName"` |
| | | Runmode string `mapstructure: "runmode"` |
| | | JwtSecret string `mapstructure: "jwtSecret"` |
| | | JwtExpire string `mapstructure: "jwtExpire"` |
| | |
| | | SudoPassword string `mapstructure: "sudoPassword"` //系统密码 |
| | | SysThresholds []threshold `mapstructure: "sysThresholds"` |
| | | PTZSpeed int `mapstructure: "ptzSpeed"` // 云台移动速度 |
| | | PatchPath string `mapstructure:"patchPath"` //系统更新包路径 |
| | | BakPath string `mapstructure:"bakPath"` //系统更新包路径 |
| | | } |
| | | |
| | | var Server = &server{} |
| | |
| | | } |
| | | |
| | | type esindexlist struct { |
| | | AiOcean index `mapstructure:"aiOcean"` |
| | | AiOcean index `mapstructure:"aiOcean"` |
| | | } |
| | | type index struct { |
| | | IndexName string `mapstructure:"index"` |
| | |
| | | Port string `mapstructure:"port"` |
| | | } |
| | | |
| | | type elastic struct { |
| | | IndexName string `mapstructure: "indexName"` |
| | | IndexType string `mapstructure: "indexType"` |
| | | } |
| | | |
| | | var SoPath = &sopath{} |
| | | |
| | | var EsInfo = &esinfo{} |
| | | |
| | | var BasicFS = &elastic{} |
| | | |
| | | type facedetect struct { |
| | | Ip string `mapstructure:"Ip"` |
| | |
| | | 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) |
| | | log.Fatal("error on parsing configuration file", err) |
| | | } |
| | | viper.UnmarshalKey("es", EsInfo) |
| | | viper.UnmarshalKey("server", Server) |
| | |
| | | viper.UnmarshalKey("facedetect", FaceDetectSet) |
| | | viper.UnmarshalKey("dbpersoncompare", DbPersonCompInfo) |
| | | viper.UnmarshalKey("espersoncompare", EsCompServerInfo) |
| | | viper.UnmarshalKey("elastic.basicFS", BasicFS) |
| | | } |