mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Alerting: Validate contact point configuration during the migration This minimises the chances of generating broken configuration as part of the migration. Originally, we wanted to generate it and not produce a hard stop in Grafana but this strategy has the chance to avoid delivering notifications for our users. We now think it's better to hard stop the migration and let the user take care of resolving the configuration manually.
33 lines
840 B
Go
33 lines
840 B
Go
package channels
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/infra/log"
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
// Base is the base implementation of a notifier. It contains the common fields across all notifier types.
|
|
type Base struct {
|
|
Name string
|
|
Type string
|
|
UID string
|
|
IsDefault bool
|
|
DisableResolveMessage bool
|
|
|
|
log log.Logger
|
|
}
|
|
|
|
func (n *Base) GetDisableResolveMessage() bool {
|
|
return n.DisableResolveMessage
|
|
}
|
|
|
|
func NewBase(model *models.AlertNotification) *Base {
|
|
return &Base{
|
|
UID: model.Uid,
|
|
Name: model.Name,
|
|
IsDefault: model.IsDefault,
|
|
Type: model.Type,
|
|
DisableResolveMessage: model.DisableResolveMessage,
|
|
log: log.New("alerting.notifier." + model.Name),
|
|
}
|
|
}
|