From cc8263fb876b44a25960bc553ed13b9fbbef18e6 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 24 四月 2024 18:50:08 +0800
Subject: [PATCH] 添加1400客户端

---
 config/config.go |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/config/config.go b/config/config.go
index 97fdb61..6802574 100644
--- a/config/config.go
+++ b/config/config.go
@@ -16,6 +16,20 @@
 	Password string `mapstructure:"password"`
 }
 
+type client struct {
+	DeviceID          string `mapstructure:"device-id"`
+	Username          string `mapstructure:"username"`
+	Password          string `mapstructure:"password"`
+	ServerAddr        string `mapstructure:"server-addr"`
+	ServerPort        string `mapstructure:"server-port"`
+	Proto             string `mapstructure:"proto" `             // http, https
+	UploadType        string `mapstructure:"upload-type"`        // binary, url
+	ChannelNo         string `mapstructure:"channel-number"`     // 閫氶亾鍙�, 鍚宨d
+	HeartbeatInterval int    `mapstructure:"heartbeat-interval"` // 蹇冭烦鍛ㄦ湡
+	HeartbeatCount    int    `mapstructure:"heartbeat-count"`    // 蹇冭烦瓒呮椂娆℃暟
+	Enable            bool   `mapstructure:"enable"`
+}
+
 type logConfig struct {
 	LogWay string `mapstructure:"log-way"` // 鏃ュ織杈撳嚭
 	Path   string `mapstructure:"path"`    // 鏃ュ織瀛樺偍璺緞
@@ -29,6 +43,7 @@
 	ReportInterval int    `mapstructure:"report-interval"`
 	RetryInterval  int    `mapstructure:"retry-interval"`
 	CutFaceImage   bool   `mapstructure:"cut-face-image"`
+	Enable         bool   `mapstructure:"enable"`
 }
 
 type rateLimitConfig struct {
@@ -40,6 +55,7 @@
 var LogConf = &logConfig{}
 var ForwardConf = &forward{}
 var RateLimitConf = &rateLimitConfig{}
+var ClientConf = &client{}
 
 // Init is an exported method that takes the environment starts the viper
 // (external lib) and returns the configuration struct.
@@ -67,6 +83,7 @@
 	v.UnmarshalKey("log", LogConf)
 	v.UnmarshalKey("forward", ForwardConf)
 	v.UnmarshalKey("rate-limit", RateLimitConf)
+	v.UnmarshalKey("client", ClientConf)
 
 	if LogConf.Level == "" {
 		LogConf.Level = "info"

--
Gitblit v1.8.0