Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
AddHandler returns an add handler
func DeleteHandler ¶
DeleteHandler returns a delete handler
func StoreHandler ¶
StoreHandler returns an Echo handler for storing payloads
Types ¶
type Alert ¶
type Alert struct {
Status string `json:"status"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations,omitempty"`
StartsAt time.Time `json:"startsAt,omitempty"`
EndsAt time.Time `json:"endsAt,omitempty"`
GeneratorURL string `json:"generatorURL,omitempty"`
}
Alert describes a notification alert
type PGPayload ¶
type PGPayload struct {
ID int64 `db:"id"`
CreatedAt time.Time `db:"created_at"`
Payload types.JSONText `db:"payload"`
}
PGPayload is an entry in the alerts table that wraps Payload
type PGStorer ¶
type PGStorer struct {
// contains filtered or unexported fields
}
PGStorer is an PostgreSQL implementation of the Storer interface
type Payload ¶
type Payload struct {
Receiver string `json:"receiver,omitempty"`
Status string `json:"status,omitempty"`
Alerts []Alert `json:"alerts,omitempty"`
GroupLabels map[string]string `json:"groupLabels,omitempty"`
CommonLabels map[string]string `json:"commonLabels,omitempty"`
CommonAnnotations map[string]string `json:"commonAnnotations,omitempty"`
ExternalURL string `json:"externalURL,omitempty"`
Version string `json:"version,omitempty"`
GroupKey string `json:"groupKey,omitempty"`
AlertName string `json:"alertName,omitempty"`
}
Payload describes the webhook payload as send by the notification service
Click to show internal directories.
Click to hide internal directories.