From 9d88c7c467f8d93af4aab9ba0b6d6c01c2ffc546 Mon Sep 17 00:00:00 2001 From: sunty <1172534965@qq.com> Date: 星期四, 20 八月 2020 20:35:30 +0800 Subject: [PATCH] add get buckets contrl --- extend/config/config.go | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/extend/config/config.go b/extend/config/config.go index 32e4f13..ff08f67 100644 --- a/extend/config/config.go +++ b/extend/config/config.go @@ -11,6 +11,7 @@ Color string `mapstructure: "color"` } type server struct { + ServerName string `mapstructure: "serverName"` Runmode string `mapstructure: "runmode"` JwtSecret string `mapstructure: "jwtSecret"` JwtExpire string `mapstructure: "jwtExpire"` @@ -29,6 +30,8 @@ SudoPassword string `mapstructure: "sudoPassword"` //绯荤粺瀵嗙爜 SysThresholds []threshold `mapstructure: "sysThresholds"` PTZSpeed int `mapstructure: "ptzSpeed"` // 浜戝彴绉诲姩閫熷害 + PatchPath string `mapstructure:"patchPath"` //绯荤粺鏇存柊鍖呰矾寰� + BakPath string `mapstructure:"bakPath"` //绯荤粺鏇存柊鍖呰矾寰� } var Server = &server{} @@ -40,7 +43,7 @@ } type esindexlist struct { - AiOcean index `mapstructure:"aiOcean"` + AiOcean index `mapstructure:"aiOcean"` } type index struct { IndexName string `mapstructure:"index"` @@ -52,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"` @@ -77,16 +87,21 @@ 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) + log.Fatal("error on parsing configuration file", err) } viper.UnmarshalKey("es", EsInfo) viper.UnmarshalKey("server", Server) @@ -94,4 +109,6 @@ viper.UnmarshalKey("facedetect", FaceDetectSet) viper.UnmarshalKey("dbpersoncompare", DbPersonCompInfo) viper.UnmarshalKey("espersoncompare", EsCompServerInfo) + viper.UnmarshalKey("elastic.basicFS", BasicFS) + viper.UnmarshalKey("shop", ShopConf) } -- Gitblit v1.8.0