From 2c84a93c4faad5e09900fc71f045a181bdb313a6 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期四, 05 三月 2020 18:55:26 +0800
Subject: [PATCH] fix
---
extend/config/config.go | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/extend/config/config.go b/extend/config/config.go
index 4dd7ec8..3ba1941 100644
--- a/extend/config/config.go
+++ b/extend/config/config.go
@@ -6,7 +6,12 @@
"github.com/spf13/viper"
)
+type threshold struct {
+ Value int `mapstructure: "value"`
+ Color string `mapstructure: "color"`
+}
type server struct {
+ ServerName string `mapstructure: "serverName"`
Runmode string `mapstructure: "runmode"`
JwtSecret string `mapstructure: "jwtSecret"`
JwtExpire string `mapstructure: "jwtExpire"`
@@ -22,7 +27,11 @@
ChannelCount string `mapstructure: "channelCount"` //閫氶亾涓暟
DiskCount string `mapstructure: "diskCount"` //纭洏涓暟
- SysServerPort string `mapstructure: "SysServerPort"`
+ SudoPassword string `mapstructure: "sudoPassword"` //绯荤粺瀵嗙爜
+ SysThresholds []threshold `mapstructure: "sysThresholds"`
+ PTZSpeed int `mapstructure: "ptzSpeed"` // 浜戝彴绉诲姩閫熷害
+ PatchPath string `mapstructure:"patchPath"` //绯荤粺鏇存柊鍖呰矾寰�
+ BakPath string `mapstructure:"bakPath"` //绯荤粺鏇存柊鍖呰矾寰�
}
var Server = &server{}
@@ -34,10 +43,7 @@
}
type esindexlist struct {
- VideoPersons index `mapstructure:"videopersons"`
- DbTables index `mapstructure:"dbtables"`
- Dbtablepersons index `mapstructure:"dbtablepersons"`
- Personaction index `mapstructure:"personaction"`
+ AiOcean index `mapstructure:"aiOcean"`
}
type index struct {
IndexName string `mapstructure:"index"`
@@ -49,9 +55,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"`
@@ -83,7 +96,7 @@
viper.AddConfigPath("/opt/vasystem/config/")
err = viper.ReadInConfig()
if err != nil {
- log.Fatal("error on parsing configuration file")
+ log.Fatal("error on parsing configuration file", err)
}
viper.UnmarshalKey("es", EsInfo)
viper.UnmarshalKey("server", Server)
@@ -91,4 +104,5 @@
viper.UnmarshalKey("facedetect", FaceDetectSet)
viper.UnmarshalKey("dbpersoncompare", DbPersonCompInfo)
viper.UnmarshalKey("espersoncompare", EsCompServerInfo)
+ viper.UnmarshalKey("elastic.basicFS", BasicFS)
}
--
Gitblit v1.8.0