zhangzengfei
2024-04-28 62beabfd1466fd3a6b6c0736acc8c5a3b3ec4b3b
config/config.go
@@ -17,17 +17,17 @@
}
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"`     // 通道号, 同id
   HeartbeatInterval int    `mapstructure:"heartbeat-interval"` // 心跳周期
   HeartbeatCount    int    `mapstructure:"heartbeat-count"`    // 心跳超时次数
   Enable            bool   `mapstructure:"enable"`
   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"`     // 通道号, 同id
   HeartbeatInterval  int    `mapstructure:"heartbeat-interval"` // 心跳周期
   HeartbeatFailCount int    `mapstructure:"heartbeat-count"`    // 心跳超时次数
   Enable             bool   `mapstructure:"enable"`
}
type logConfig struct {
@@ -97,5 +97,13 @@
      ForwardConf.RetryInterval = 5
   }
   if ClientConf.HeartbeatInterval == 0 {
      ClientConf.HeartbeatInterval = 30
   }
   if ClientConf.Proto == "" {
      ClientConf.Proto = "http"
   }
   logger.SetLogLevel(LogConf.Level)
}