mirror of
https://github.com/grafana/grafana.git
synced 2026-08-19 01:34:54 -05:00
* Introduce AlertsRouter in the sender package, and move all fields and methods related to notifications out of the scheduler to this router. * Introduce a new interface AlertsSender in the schedule package and replace calls of anonymous function `notify` inside the ruleRoutine to calling methods of that interface. * Rename interface Scheduler in api package to ExternalAlertmanagerProvider, and replace scheduler with AlertRouter as struct that implements the interface.
87 lines
2.2 KiB
Go
87 lines
2.2 KiB
Go
// Code generated by mockery v2.10.0. DO NOT EDIT.
|
|
|
|
package schedule
|
|
|
|
import (
|
|
context "context"
|
|
|
|
events "github.com/grafana/grafana/pkg/events"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
models "github.com/grafana/grafana/pkg/services/ngalert/models"
|
|
|
|
time "time"
|
|
)
|
|
|
|
// FakeScheduleService is an autogenerated mock type for the ScheduleService type
|
|
type FakeScheduleService struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// DeleteAlertRule provides a mock function with given fields: key
|
|
func (_m *FakeScheduleService) DeleteAlertRule(key models.AlertRuleKey) {
|
|
_m.Called(key)
|
|
}
|
|
|
|
// Run provides a mock function with given fields: _a0
|
|
func (_m *FakeScheduleService) Run(_a0 context.Context) error {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// UpdateAlertRule provides a mock function with given fields: key
|
|
func (_m *FakeScheduleService) UpdateAlertRule(key models.AlertRuleKey) {
|
|
_m.Called(key)
|
|
}
|
|
|
|
// UpdateAlertRulesByNamespaceUID provides a mock function with given fields: ctx, orgID, uid
|
|
func (_m *FakeScheduleService) UpdateAlertRulesByNamespaceUID(ctx context.Context, orgID int64, uid string) error {
|
|
ret := _m.Called(ctx, orgID, uid)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, string) error); ok {
|
|
r0 = rf(ctx, orgID, uid)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// evalApplied provides a mock function with given fields: _a0, _a1
|
|
func (_m *FakeScheduleService) evalApplied(_a0 models.AlertRuleKey, _a1 time.Time) {
|
|
_m.Called(_a0, _a1)
|
|
}
|
|
|
|
// folderUpdateHandler provides a mock function with given fields: ctx, evt
|
|
func (_m *FakeScheduleService) folderUpdateHandler(ctx context.Context, evt *events.FolderUpdated) error {
|
|
ret := _m.Called(ctx, evt)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *events.FolderUpdated) error); ok {
|
|
r0 = rf(ctx, evt)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// overrideCfg provides a mock function with given fields: cfg
|
|
func (_m *FakeScheduleService) overrideCfg(cfg SchedulerCfg) {
|
|
_m.Called(cfg)
|
|
}
|
|
|
|
// stopApplied provides a mock function with given fields: _a0
|
|
func (_m *FakeScheduleService) stopApplied(_a0 models.AlertRuleKey) {
|
|
_m.Called(_a0)
|
|
}
|