-
Notifications
You must be signed in to change notification settings - Fork 173
/
models.go
119 lines (113 loc) · 2.7 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
118
119
package config
import (
"regexp"
"time"
)
type alertmanagerConfig struct {
Name string
URI string
ExternalURI string `yaml:"external_uri" mapstructure:"external_uri"`
Timeout time.Duration
Proxy bool
TLS struct {
CA string
Cert string
Key string
InsecureSkipVerify bool `yaml:"insecureSkipVerify" mapstructure:"insecureSkipVerify"`
}
Headers map[string]string
}
type jiraRule struct {
Regex string
URI string
}
type CustomLabelColor struct {
Value string `yaml:"value" mapstructure:"value"`
ValueRegex string `yaml:"value_re" mapstructure:"value_re"`
CompiledRegex *regexp.Regexp `yaml:"-" mapstructure:"-"`
Color string `yaml:"color" mapstructure:"color"`
}
type CustomLabelColors map[string][]CustomLabelColor
type configSchema struct {
Alertmanager struct {
Interval time.Duration
Servers []alertmanagerConfig
}
Annotations struct {
Default struct {
Hidden bool
}
Hidden []string
Visible []string
Keep []string
Strip []string
}
Custom struct {
CSS string
JS string
}
Debug bool
Filters struct {
Default []string
}
Grid struct {
Sorting struct {
Order string
Reverse bool
Label string
CustomValues struct {
Labels map[string]map[string]string
} `yaml:"customValues" mapstructure:"customValues"`
}
}
Karma struct {
Name string
}
Labels struct {
Keep []string
Strip []string
Color struct {
Custom CustomLabelColors
Static []string
Unique []string
}
}
Listen struct {
Address string
Port int
Prefix string
}
Log struct {
Config bool
Level string
Format string
}
JIRA []jiraRule
Receivers struct {
Keep []string
Strip []string
}
Sentry struct {
Private string
Public string
}
SilenceForm struct {
Author struct {
PopulateFromHeader struct {
Header string `yaml:"header" mapstructure:"header"`
ValueRegex string `yaml:"value_re" mapstructure:"value_re"`
} `yaml:"populate_from_header" mapstructure:"populate_from_header"`
} `yaml:"author" mapstructure:"author"`
Strip struct {
Labels []string
}
} `yaml:"silenceForm" mapstructure:"silenceForm"`
UI struct {
Refresh time.Duration
HideFiltersWhenIdle bool `yaml:"hideFiltersWhenIdle" mapstructure:"hideFiltersWhenIdle"`
ColorTitlebar bool `yaml:"colorTitlebar" mapstructure:"colorTitlebar"`
MinimalGroupWidth int `yaml:"minimalGroupWidth" mapstructure:"minimalGroupWidth"`
AlertsPerGroup int `yaml:"alertsPerGroup" mapstructure:"alertsPerGroup"`
CollapseGroups string `yaml:"collapseGroups" mapstructure:"collapseGroups"`
}
}