-
Notifications
You must be signed in to change notification settings - Fork 7
/
mega_structs.go
94 lines (83 loc) · 1.68 KB
/
mega_structs.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
package main
import "time"
import "sync"
type PayloadOfRequest struct {
req string
}
type Tracker map[string]bool
type MegaConfig struct {
Mail MailSettings
Servers []Server
Cl Clock
Contacts []Contact
SMS TwilioInfo
Misc Settings
LastReset int64
KubeSettings k8sConfig
AlertsHistory Tracker
}
type TrLock struct {
Lock *sync.RWMutex
}
type Server struct {
Host, Image, Nickname string
Endpoints []Endpoint
Live bool
ID string
Uptime float64
}
type Endpoint struct {
Uptime float64
Method, Path, Headers, Data string
Timeout time.Duration
}
type RequestLog struct {
Requests []Request
}
type Request struct {
Code int
Owner string
}
type Contact struct {
Nickname, Email string
Threshold float64
Watching []string
Pods []string
ID, Phone string
}
type MailSettings struct {
Email, Password, Host, Port string
}
type Settings struct {
ResetInterval int64
}
type Clock struct {
Interval int
}
type TwilioInfo struct {
Token, SID, From, CountryCode string
}
// k8s settings
type k8sConfig struct {
MetricAPIHost string
MetricAPIPort string
MetricAPIPath string
MetricNamespace string
BadConfig bool
Monitoring []PodConfig
}
// Pod metric informatino
type Pod struct {
Metadata JSONString `json:"metadata"`
Timestamp string `json:"timestamp"`
Containers MPArray `json:"containers"`
}
type PodConfig struct {
MaxCPU int64
MaxMemory int64
Name string
Watching, Group bool
}
type PodMetricList struct {
Items []Pod `json:"items"`
}