Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFuncs = FuncMap{ "toUpper": strings.ToUpper, "toLower": strings.ToLower, "title": strings.Title, "join": func(sep string, s []string) string { return strings.Join(s, sep) }, "match": regexp.MatchString, "safeHtml": func(text string) tmplhtml.HTML { return tmplhtml.HTML(text) }, "reReplaceAll": func(pattern, repl, text string) string { re := regexp.MustCompile(pattern) return re.ReplaceAllString(text, repl) }, "stringSlice": func(s ...string) []string { return s }, }
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { Status string `json:"status"` Labels KV `json:"labels"` Annotations KV `json:"annotations"` StartsAt time.Time `json:"startsAt"` EndsAt time.Time `json:"endsAt"` GeneratorURL string `json:"generatorURL"` Fingerprint string `json:"fingerprint"` }
Alert holds one alert for notification templates.
type Alerts ¶
type Alerts []Alert
Alerts is a list of Alert objects.
type Data ¶
type Data struct { Receiver string `json:"receiver"` Status string `json:"status"` Alerts Alerts `json:"alerts"` GroupLabels KV `json:"groupLabels"` CommonLabels KV `json:"commonLabels"` CommonAnnotations KV `json:"commonAnnotations"` ExternalURL string `json:"externalURL"` }
Data is the data passed to notification templates and webhook pushes.
End-users should not be exposed to Go's type system, as this will confuse them and prevent simple things like simple equality checks to fail. Map everything to float64/string.
type KV ¶
KV is a set of key/value string pairs.
func (KV) SortedPairs ¶
SortedPairs returns a sorted list of key/value pairs.
type Template ¶
Template bundles a text and a html template instance.
func FromGlobs ¶
FromGlobs calls ParseGlob on all path globs provided and returns the resulting Template.
func (*Template) ExecuteHTMLString ¶
ExecuteHTMLString needs a meaningful doc comment (TODO(fabxc)).
Click to show internal directories.
Click to hide internal directories.