mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-22 07:53:38 +01:00
35 lines
1.4 KiB
Go
35 lines
1.4 KiB
Go
package provider
|
|
|
|
import (
|
|
"github.com/TwinProduction/gatus/alerting/provider/custom"
|
|
"github.com/TwinProduction/gatus/alerting/provider/discord"
|
|
"github.com/TwinProduction/gatus/alerting/provider/mattermost"
|
|
"github.com/TwinProduction/gatus/alerting/provider/messagebird"
|
|
"github.com/TwinProduction/gatus/alerting/provider/pagerduty"
|
|
"github.com/TwinProduction/gatus/alerting/provider/slack"
|
|
"github.com/TwinProduction/gatus/alerting/provider/telegram"
|
|
"github.com/TwinProduction/gatus/alerting/provider/twilio"
|
|
"github.com/TwinProduction/gatus/core"
|
|
)
|
|
|
|
// AlertProvider is the interface that each providers should implement
|
|
type AlertProvider interface {
|
|
// IsValid returns whether the provider's configuration is valid
|
|
IsValid() bool
|
|
|
|
// ToCustomAlertProvider converts the provider into a custom.AlertProvider
|
|
ToCustomAlertProvider(service *core.Service, alert *core.Alert, result *core.Result, resolved bool) *custom.AlertProvider
|
|
}
|
|
|
|
var (
|
|
// Validate interface implementation on compile
|
|
_ AlertProvider = (*custom.AlertProvider)(nil)
|
|
_ AlertProvider = (*discord.AlertProvider)(nil)
|
|
_ AlertProvider = (*mattermost.AlertProvider)(nil)
|
|
_ AlertProvider = (*messagebird.AlertProvider)(nil)
|
|
_ AlertProvider = (*pagerduty.AlertProvider)(nil)
|
|
_ AlertProvider = (*slack.AlertProvider)(nil)
|
|
_ AlertProvider = (*telegram.AlertProvider)(nil)
|
|
_ AlertProvider = (*twilio.AlertProvider)(nil)
|
|
)
|