alert

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

alert package implements how to kick the alert.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAlertURL = errors.New("invalid alert URL")
)

Functions

This section is empty.

Types

type Alert

type Alert interface {
	Trigger(context.Context, *api.Incident, probe.Reporter)
}

func New

func New(target string) (Alert, error)

type AlertReporter

type AlertReporter struct {
	Upstream probe.Reporter
}

func (AlertReporter) Report

func (r AlertReporter) Report(rec api.Record)

type AlertSet added in v0.11.0

type AlertSet []Alert

AlertSet is a set of alerts. It also implements Alert alertinterface.

func NewSet added in v0.11.0

func NewSet(targets []string) (AlertSet, error)

func (AlertSet) Trigger added in v0.11.0

func (as AlertSet) Trigger(ctx context.Context, i *api.Incident, r probe.Reporter)

Trigger of AlertSet calls all Trigger methods of children parallelly. This method blocks until all alerts done.

type PluginAlert

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

func NewPluginAlert

func NewPluginAlert(target string) (PluginAlert, error)

func (PluginAlert) Trigger

func (a PluginAlert) Trigger(ctx context.Context, incident *api.Incident, r probe.Reporter)

type ProbeAlert

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

func (ProbeAlert) Trigger

func (a ProbeAlert) Trigger(ctx context.Context, incident *api.Incident, r probe.Reporter)

type ReplaceReporter

type ReplaceReporter struct {
	Target   *url.URL
	Upstream probe.Reporter
}

func (ReplaceReporter) Report

func (r ReplaceReporter) Report(rec api.Record)

Jump to

Keyboard shortcuts

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