-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
39 lines (32 loc) · 865 Bytes
/
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
package healthcheck
// Health give the status and its dependencies
type Health struct {
Name string `json:"name"`
URL string `json:"url"`
Status HealthStatus `json:"status"`
Dependencies []Health `json:"dependencies,omitempty"`
}
// Dependencies list the dependencies to test
type Dependencies struct {
Dependencies []Dependency `json:"dependencies"`
}
// HealthCheck model
type HealthCheck struct {
URL string
Name string
Dependencies string
}
// Dependency what to test
type Dependency struct {
URL string `json:"url"`
Name string `json:"name"`
Ping bool `json:"ping"`
}
// HealthStatus define its type
type HealthStatus string
const (
// HealthPass set its status to passed
HealthPass HealthStatus = "pass"
// HealthFail set its status to failed
HealthFail HealthStatus = "fail"
)