sunty
2020-01-15 49ceaa0374fb3f0d74a4949953b0355359b3bf49
extend/config/config.go
@@ -29,8 +29,8 @@
   SudoPassword  string      `mapstructure: "sudoPassword"` //系统密码
   SysThresholds []threshold `mapstructure: "sysThresholds"`
   PTZSpeed      int         `mapstructure: "ptzSpeed"` // 云台移动速度
   PatchPath       string `mapstructure:"patchPath"`//系统更新包路径
   BakPath         string `mapstructure:"bakPath"`//系统更新包路径
   PatchPath     string      `mapstructure:"patchPath"` //系统更新包路径
   BakPath       string      `mapstructure:"bakPath"`   //系统更新包路径
}
var Server = &server{}
@@ -42,7 +42,7 @@
}
type esindexlist struct {
   AiOcean   index `mapstructure:"aiOcean"`
   AiOcean index `mapstructure:"aiOcean"`
}
type index struct {
   IndexName string `mapstructure:"index"`
@@ -54,9 +54,16 @@
   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"`
@@ -88,7 +95,7 @@
   viper.AddConfigPath("/opt/vasystem/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)
@@ -96,4 +103,5 @@
   viper.UnmarshalKey("facedetect", FaceDetectSet)
   viper.UnmarshalKey("dbpersoncompare", DbPersonCompInfo)
   viper.UnmarshalKey("espersoncompare", EsCompServerInfo)
   viper.UnmarshalKey("elastic.basicFS", BasicFS)
}