alert

package
v0.0.0-...-621658c Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTooManyRequests is returned when a given alert is sent too many times.
	ErrTooManyRequests = errors.New("too many requests")
)

Functions

This section is empty.

Types

type Alert

type Alert struct {
	// Destination is the identifier indicating where the alert should be routed by the alert receiver.
	Destination string

	// Title is the title of the alert.
	Title string

	// Summary is a short summary of the alert.
	Summary string

	// Description is a longer details of the alert.
	Description string

	// Severity is the severity of the alert.
	Severity int

	// Source is the identifier of the source of the alert.  This is typically the name of the alert rule.
	Source string

	// Correlation ID is an identifier for an alert or deduplicate multiple events.  This can be used by receivers
	// to indicate that an alert is still firing.
	CorrelationID string

	// CustomerFields is a map of key/value pairs that provide additional information about the alert.
	CustomFields map[string]string
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for alert notification services. Notification services implement the JSON http API to receive alerts from the alerter service.

func NewClient

func NewClient(timeout time.Duration) (*Client, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, endpoint string, alert Alert) error

Jump to

Keyboard shortcuts

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