Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AlertColors = map[string]string{
"alert": "black",
"information": "blue",
"warning": "orange",
"critical": "red",
"resolved": "green",
"silenced": "gray",
}
AlertColors represent the colors corresponding to the alert status
View Source
var AlertIcons = map[string]string{
"alert": "🔔️",
"information": "ℹ️",
"warning": "⚠️",
"critical": "🚨",
"resolved": "✅",
"silenced": "🔕",
}
AlertIcons represent the icons corresponding to the alert status
Functions ¶
func CreateMessage ¶
CreateMessage formats a message using the status, name and summary
func FormatAlerts ¶
func FormatAlerts(alerts []*alertmanager.Alert, labels bool) (string, string)
FormatAlerts formats alerts as plain text and HTML
Types ¶
type Client ¶
type Client struct { Matrix *matrix.Client Alertmanager *alertmanager.Client // contains filtered or unexported fields }
Client represents an Alertmanager/Matrix client
func NewClient ¶
func NewClient(homeserver, userID, token, messageType, rooms, alertmanagerURL string) (client *Client, err error)
NewClient creates and starts a new Alertmanager/Matrix client
func (*Client) DelSilence ¶
DelSilence deletes silences
func (*Client) NewSilence ¶
NewSilence creates a new silence and returns the ID
Click to show internal directories.
Click to hide internal directories.