2020-04-27 23:19:27 +02:00
|
|
|
package notifier
|
|
|
|
|
2020-05-10 18:58:17 +02:00
|
|
|
import "context"
|
|
|
|
|
2021-08-31 11:28:02 +02:00
|
|
|
// Notifier is a common interface for alert manager provider
|
2020-04-27 23:19:27 +02:00
|
|
|
type Notifier interface {
|
2021-08-31 11:28:02 +02:00
|
|
|
// Send sends the given list of alerts.
|
|
|
|
// Returns an error if fails to send the alerts.
|
|
|
|
// Must unblock if the given ctx is cancelled.
|
2020-05-10 18:58:17 +02:00
|
|
|
Send(ctx context.Context, alerts []Alert) error
|
2021-08-31 11:28:02 +02:00
|
|
|
// Addr returns address where alerts are sent.
|
|
|
|
Addr() string
|
2022-02-02 13:11:41 +01:00
|
|
|
// Close is a destructor for the Notifier
|
|
|
|
Close()
|
2020-04-27 23:19:27 +02:00
|
|
|
}
|