31 lines
1.2 KiB
Go
31 lines
1.2 KiB
Go
package component
|
||
|
||
import "time"
|
||
|
||
// 组件详情
|
||
type Component struct {
|
||
COMName string `json:"comName"` // 组件名称,枚举:Telegraf、ProcessExporter
|
||
COMPort int64 `json:"comPort"` // 组件端口
|
||
COMType string `json:"comType"` // 组件类型,中文描述既可
|
||
COMVersion string `json:"comVersion"` // 组件版本
|
||
Config Config `json:"config"` // 组件配置(传json字符串),每个组件的信息不同
|
||
LastStarttime time.Time `json:"lastStarttime"` // 最近运行时间, 2023-08-16 00:00:00
|
||
Status string `json:"status"` // 组件状态,0:离线,1:在线,2:故障
|
||
}
|
||
|
||
// Config 组件配置(传json字符串),每个组件的信息不同
|
||
//
|
||
// # Telegraf配置
|
||
//
|
||
// ProcessExporter配置
|
||
type Config struct {
|
||
Metrics []string `json:"metrics,omitempty"`
|
||
MetricServer []MetricServer `json:"metricServer,omitempty"` // 指标服务器名称
|
||
Tags map[string]string `json:"tags,omitempty"` // 标签,map[string]string类型
|
||
}
|
||
|
||
type MetricServer struct {
|
||
Address string `json:"address"` // 指标服务器地址
|
||
Name string `json:"name"` // 指标服务器名称
|
||
}
|