internal

package
v0.0.0-...-2042b1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DSNVar = "ALERTSNITCH_DSN"

DSNVar Environment variable in which the DSN is stored

Variables

This section is empty.

Functions

This section is empty.

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"`
	ValueString  string            `json:"valueString"`
}

Alert holds one alert for notification templates.

type AlertGroup

type AlertGroup struct {
	Version  string `json:"version"`
	GroupKey string `json:"groupKey"`

	Receiver string `json:"receiver"`
	Status   string `json:"status"`
	Alerts   Alerts `json:"alerts"`

	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`

	ExternalURL string `json:"externalURL"`
}

AlertGroup is the data read from a webhook call

type Alerts

type Alerts []Alert

Alerts is a slice of Alert

type Storer

type Storer interface {
	Save(*AlertGroup) error
	Ping() error
	CheckModel() error
}

Storer saves an Alert Data into a persistence engine

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL