| | |
| | | } |
| | | |
| | | 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 { |
| | |
| | | ForwardConf.RetryInterval = 5 |
| | | } |
| | | |
| | | if ClientConf.HeartbeatInterval == 0 { |
| | | ClientConf.HeartbeatInterval = 30 |
| | | } |
| | | |
| | | if ClientConf.Proto == "" { |
| | | ClientConf.Proto = "http" |
| | | } |
| | | |
| | | logger.SetLogLevel(LogConf.Level) |
| | | } |