-
Notifications
You must be signed in to change notification settings - Fork 125
/
models.go
117 lines (101 loc) · 3.79 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// Copyright 2024 PingCAP, Inc. Licensed under Apache-2.0.
package topology
type ComponentStatus uint
const (
ComponentStatusUnreachable ComponentStatus = 0
ComponentStatusUp ComponentStatus = 1
ComponentStatusTombstone ComponentStatus = 2
ComponentStatusOffline ComponentStatus = 3
ComponentStatusDown ComponentStatus = 4
)
type PDInfo struct {
GitHash string `json:"git_hash"`
Version string `json:"version"`
IP string `json:"ip"`
Port uint `json:"port"`
DeployPath string `json:"deploy_path"`
Status ComponentStatus `json:"status"`
StartTimestamp int64 `json:"start_timestamp"` // Ts = 0 means unknown
}
type TiDBInfo struct {
GitHash string `json:"git_hash"`
Version string `json:"version"`
IP string `json:"ip"`
Port uint `json:"port"`
DeployPath string `json:"deploy_path"`
Status ComponentStatus `json:"status"`
StatusPort uint `json:"status_port"`
StartTimestamp int64 `json:"start_timestamp"`
}
type TiCDCInfo struct {
ClusterName string `json:"cluster_name"`
GitHash string `json:"git_hash"`
Version string `json:"version"`
IP string `json:"ip"`
Port uint `json:"port"`
DeployPath string `json:"deploy_path"`
Status ComponentStatus `json:"status"`
StatusPort uint `json:"status_port"`
StartTimestamp int64 `json:"start_timestamp"`
}
type TiProxyInfo struct {
GitHash string `json:"git_hash"`
Version string `json:"version"`
IP string `json:"ip"`
Port uint `json:"port"`
DeployPath string `json:"deploy_path"`
Status ComponentStatus `json:"status"`
StatusPort uint `json:"status_port"`
StartTimestamp int64 `json:"start_timestamp"`
}
type TSOInfo struct {
GitHash string `json:"git_hash"`
Version string `json:"version"`
IP string `json:"ip"`
Port uint `json:"port"`
DeployPath string `json:"deploy_path"`
Status ComponentStatus `json:"status"`
StartTimestamp int64 `json:"start_timestamp"`
}
type SchedulingInfo struct {
GitHash string `json:"git_hash"`
Version string `json:"version"`
IP string `json:"ip"`
Port uint `json:"port"`
DeployPath string `json:"deploy_path"`
Status ComponentStatus `json:"status"`
StartTimestamp int64 `json:"start_timestamp"`
}
// Store may be a TiKV store or TiFlash store.
type StoreInfo struct {
GitHash string `json:"git_hash"`
Version string `json:"version"`
IP string `json:"ip"`
Port uint `json:"port"`
DeployPath string `json:"deploy_path"`
Status ComponentStatus `json:"status"`
StatusPort uint `json:"status_port"`
Labels map[string]string `json:"labels"`
StartTimestamp int64 `json:"start_timestamp"`
}
type StoreLabels struct {
Address string `json:"address"`
Labels map[string]string `json:"labels"`
}
type StoreLocation struct {
LocationLabels []string `json:"location_labels"`
Stores []StoreLabels `json:"stores"`
}
type StandardComponentInfo struct {
IP string `json:"ip"`
Port uint `json:"port"`
}
type AlertManagerInfo struct {
StandardComponentInfo
}
type GrafanaInfo struct {
StandardComponentInfo
}
type PrometheusInfo struct {
StandardComponentInfo
}