2020-09-24 19:54:15 -04:00
|
|
|
package provider
|
|
|
|
|
|
2020-09-26 14:23:43 -04:00
|
|
|
import (
|
|
|
|
|
"github.com/TwinProduction/gatus/alerting/provider/custom"
|
2021-03-04 21:26:17 -05:00
|
|
|
"github.com/TwinProduction/gatus/alerting/provider/discord"
|
2020-11-23 22:20:06 +01:00
|
|
|
"github.com/TwinProduction/gatus/alerting/provider/mattermost"
|
|
|
|
|
"github.com/TwinProduction/gatus/alerting/provider/messagebird"
|
2020-11-02 22:43:55 -05:00
|
|
|
"github.com/TwinProduction/gatus/alerting/provider/pagerduty"
|
|
|
|
|
"github.com/TwinProduction/gatus/alerting/provider/slack"
|
|
|
|
|
"github.com/TwinProduction/gatus/alerting/provider/twilio"
|
2020-09-26 14:23:43 -04:00
|
|
|
"github.com/TwinProduction/gatus/core"
|
|
|
|
|
)
|
|
|
|
|
|
2020-09-26 15:15:50 -04:00
|
|
|
// AlertProvider is the interface that each providers should implement
|
2020-09-24 19:54:15 -04:00
|
|
|
type AlertProvider interface {
|
2020-09-26 15:15:50 -04:00
|
|
|
// IsValid returns whether the provider's configuration is valid
|
2020-09-24 19:54:15 -04:00
|
|
|
IsValid() bool
|
2020-09-26 15:15:50 -04:00
|
|
|
|
|
|
|
|
// ToCustomAlertProvider converts the provider into a custom.AlertProvider
|
2020-09-26 14:23:43 -04:00
|
|
|
ToCustomAlertProvider(service *core.Service, alert *core.Alert, result *core.Result, resolved bool) *custom.AlertProvider
|
2020-09-24 19:54:15 -04:00
|
|
|
}
|
2020-11-02 22:43:55 -05:00
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
// Validate interface implementation on compile
|
|
|
|
|
_ AlertProvider = (*custom.AlertProvider)(nil)
|
2021-03-04 21:26:17 -05:00
|
|
|
_ AlertProvider = (*discord.AlertProvider)(nil)
|
2020-11-14 15:55:37 +01:00
|
|
|
_ AlertProvider = (*mattermost.AlertProvider)(nil)
|
2020-11-23 22:20:06 +01:00
|
|
|
_ AlertProvider = (*messagebird.AlertProvider)(nil)
|
2020-11-02 22:43:55 -05:00
|
|
|
_ AlertProvider = (*pagerduty.AlertProvider)(nil)
|
2021-03-04 21:26:17 -05:00
|
|
|
_ AlertProvider = (*slack.AlertProvider)(nil)
|
|
|
|
|
_ AlertProvider = (*twilio.AlertProvider)(nil)
|
2020-11-02 22:43:55 -05:00
|
|
|
)
|