Documentation
¶
Index ¶
- Constants
- func CopyMap(m map[string]string) map[string]string
- func LabelSetToFingerprint(labels map[string]string) string
- func MatchLabels(alertLabels, labelsSelector map[string]string) bool
- func MergeMaps(oldMap, newMap map[string]string)
- func MustTemplateString(tpl string, variables any, onerror string) string
- func TemplateString(tpl string, variables any) (string, error)
- type Alert
- type AlertsSlice
- type HTTPClient
- type HTTPInterface
Constants ¶
View Source
const ( Pending = "pending" Firing = "firing" Resolved = "resolved" SeparatorByte byte = 255 )
Variables ¶
This section is empty.
Functions ¶
func LabelSetToFingerprint ¶
func MatchLabels ¶
Types ¶
type Alert ¶
type Alert struct {
Status string `json:"status"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
StartsAt time.Time `json:"startsAt"`
EndsAt time.Time `json:"endsAt"`
GeneratorURL string `json:"generatorURL"`
Fingerprint string `json:"fingerprint"`
Title string `json:"title"`
LastSinkAt time.Time `json:"-"`
LastReceiveAt time.Time `json:"-"`
}
type AlertsSlice ¶
type AlertsSlice []Alert
func (AlertsSlice) Len ¶
func (a AlertsSlice) Len() int
func (AlertsSlice) Less ¶
func (a AlertsSlice) Less(i, j int) bool
func (AlertsSlice) Swap ¶
func (a AlertsSlice) Swap(i, j int)
type HTTPClient ¶
type HTTPClient struct{}
func (*HTTPClient) FetchResponse ¶
func (c *HTTPClient) FetchResponse(req *http.Request) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.