Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertmanagerEvent ¶
type AlertmanagerEvent struct { Receiver string `json:"receiver"` Status string `json:"status"` Alerts []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"` } `json:"alerts"` GroupLabels map[string]string `json:"groupLabels"` CommonLabels map[string]string `json:"commonLabels"` CommonAnnotations map[string]string `json:"commonAnnotations"` ExternalURL string `json:"externalURL"` Version string `json:"version"` GroupKey string `json:"groupKey"` TruncatedAlerts int `json:"truncatedAlerts"` }
type AlertmanagerHandler ¶
type AlertmanagerHandler struct{}
func NewAlertmanagerHandler ¶
func NewAlertmanagerHandler() AlertmanagerHandler
func (AlertmanagerHandler) ProduceNotifications ¶
func (d AlertmanagerHandler) ProduceNotifications(r *http.Request) ([]Notification, error)
type DiscordEmbedHandler ¶
type DiscordEmbedHandler struct{}
func NewDiscordEmbedHandler ¶
func NewDiscordEmbedHandler() DiscordEmbedHandler
func (DiscordEmbedHandler) ProduceNotifications ¶
func (d DiscordEmbedHandler) ProduceNotifications(r *http.Request) ([]Notification, error)
type DiscordMessage ¶
type DiscordMessage struct { Content string `json:"content"` Embeds []struct { Title string `json:"title"` Description string `json:"description"` URL string `json:"url"` Footer struct { Text string `json:"text"` } `json:"footer"` Author struct { Name string `json:"name"` URL string `json:"url"` } `json:"author"` } `json:"embeds"` }
type FluxHandler ¶
type FluxHandler struct {
// contains filtered or unexported fields
}
func NewFluxHandler ¶
func NewFluxHandler() FluxHandler
func (FluxHandler) ProduceNotifications ¶
func (f FluxHandler) ProduceNotifications(r *http.Request) ([]Notification, error)
type FluxNotification ¶
type FluxNotification struct { InvolvedObject fluxInvolvedObject `json:"involvedObject"` Severity string `json:"severity"` Timestamp time.Time `json:"timestamp"` Message string `json:"message"` Reason string `json:"reason"` Metadata struct { CommitStatus string `json:"commit_status"` Revision string `json:"revision"` Summary string `json:"summary"` } `json:"metadata"` ReportingController string `json:"reportingController"` ReportingInstance string `json:"reportingInstance"` }
type Handler ¶
type Handler interface {
ProduceNotifications(r *http.Request) ([]Notification, error)
}
type Notification ¶
type Notification struct { Title string Body string Priority int Tags []string Actions []NotificationAction IsMarkdown bool // contains filtered or unexported fields }
func (Notification) IsEmpty ¶
func (n Notification) IsEmpty() bool
func (Notification) Send ¶
func (n Notification) Send(base string) error
type NotificationAction ¶
func NewViewAction ¶
func NewViewAction(label, url string, params ...string) NotificationAction
func (NotificationAction) Format ¶
func (n NotificationAction) Format() string
type NotificationError ¶
Click to show internal directories.
Click to hide internal directories.