notifier

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotifyTargetsWithRetry

func NotifyTargetsWithRetry(targets []string, retryInterval time.Duration, retryTimeout time.Duration, alerts ...*types.Alert) error

func NotifyWatcher

func NotifyWatcher(watchdir string, targets []string, retryInterval time.Duration, retryTimeout time.Duration, forever bool) (error, chan bool)

func NotifyWithRetry

func NotifyWithRetry(target Target, targetUrl string, retryInterval time.Duration, retryTimeout time.Duration, alert ...*types.Alert) error

func UsageInfo

func UsageInfo() string

func ValidateTargetUrl

func ValidateTargetUrl(targetUrl string) error

Types

type CreateUploader

type CreateUploader func(tmpl *template.Template) Target

type Target

type Target interface {
	Notifier(targetUrl string, alerts ...*types.Alert) (bool, error)
	UsageInfo() string
}

Notifier notifies about alerts under constraints of the given context. It returns an error if unsuccessful and a flag whether the error is recoverable. This information is useful for a retry logic.

func NewNotifier

func NewNotifier(targetUrl string) (Target, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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