gatus/alerting/provider/provider.go

35 lines
1.4 KiB
Go
Raw Normal View History

2020-09-25 01:54:15 +02:00
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"
2021-03-31 01:38:34 +02:00
"github.com/TwinProduction/gatus/alerting/provider/telegram"
"github.com/TwinProduction/gatus/alerting/provider/twilio"
"github.com/TwinProduction/gatus/core"
)
2020-09-26 21:15:50 +02:00
// AlertProvider is the interface that each providers should implement
2020-09-25 01:54:15 +02:00
type AlertProvider interface {
2020-09-26 21:15:50 +02:00
// IsValid returns whether the provider's configuration is valid
2020-09-25 01:54:15 +02:00
IsValid() bool
2020-09-26 21:15:50 +02:00
// ToCustomAlertProvider converts the provider into a custom.AlertProvider
ToCustomAlertProvider(service *core.Service, alert *core.Alert, result *core.Result, resolved bool) *custom.AlertProvider
2020-09-25 01:54:15 +02:00
}
var (
// Validate interface implementation on compile
_ AlertProvider = (*custom.AlertProvider)(nil)
_ AlertProvider = (*discord.AlertProvider)(nil)
2020-11-14 15:55:37 +01:00
_ AlertProvider = (*mattermost.AlertProvider)(nil)
_ AlertProvider = (*messagebird.AlertProvider)(nil)
_ AlertProvider = (*pagerduty.AlertProvider)(nil)
_ AlertProvider = (*slack.AlertProvider)(nil)
2021-03-31 01:38:34 +02:00
_ AlertProvider = (*telegram.AlertProvider)(nil)
_ AlertProvider = (*twilio.AlertProvider)(nil)
)