File size: 1,517 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package engine

import (
	"database/sql"
	"log/slog"
	"time"

	"github.com/jackc/pgx/v5"
	"github.com/riverqueue/river"
	"github.com/target/goalert/alert"
	"github.com/target/goalert/alert/alertlog"
	"github.com/target/goalert/auth/authlink"
	"github.com/target/goalert/config"
	"github.com/target/goalert/event"
	"github.com/target/goalert/notification"
	"github.com/target/goalert/notification/nfydest"
	"github.com/target/goalert/notification/slack"
	"github.com/target/goalert/notificationchannel"
	"github.com/target/goalert/oncall"
	"github.com/target/goalert/schedule"
	"github.com/target/goalert/user"
	"github.com/target/goalert/user/contactmethod"
)

// Config contains parameters for controlling how the Engine operates.
type Config struct {
	EventBus            *event.Bus
	AlertLogStore       *alertlog.Store
	AlertStore          *alert.Store
	ContactMethodStore  *contactmethod.Store
	NotificationManager *notification.Manager
	UserStore           *user.Store
	NotificationStore   *notification.Store
	NCStore             *notificationchannel.Store
	OnCallStore         *oncall.Store
	ScheduleStore       *schedule.Store
	AuthLinkStore       *authlink.Store
	SlackStore          *slack.ChannelSender
	DestRegistry        *nfydest.Registry
	River               *river.Client[pgx.Tx]
	RiverDBSQL          *river.Client[*sql.Tx]
	RiverWorkers        *river.Workers

	ConfigSource config.Source

	MaxMessages int

	DisableCycle bool
	LogCycles    bool
	Logger       *slog.Logger

	CycleTime time.Duration
}