Documentation
¶
Index ¶
- type CheckInMonitor
- type MetricsRecorder
- type NotificationRouter
- type Scheduler
- func (s *Scheduler) Check(ctx context.Context, now time.Time)
- func (s *Scheduler) CheckInName() string
- func (s *Scheduler) RecordCheckIn(at time.Time) monitor.RecordResult
- func (s *Scheduler) RecordCheckInContext(ctx context.Context, at time.Time) monitor.RecordResult
- func (s *Scheduler) Run(ctx context.Context)
- func (s *Scheduler) Snapshot() monitor.Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckInMonitor ¶
type CheckInMonitor interface {
CheckInName() string
RecordCheckIn(at time.Time) monitor.RecordResult
Snapshot() monitor.Snapshot
Check(now time.Time) monitor.CheckResult
NextDeadline() (deadline time.Time, active bool)
}
CheckInMonitor exposes the monitor behavior managed by the scheduler.
type MetricsRecorder ¶ added in v0.0.11
type MetricsRecorder interface {
SetMonitorSnapshot(checkIn string, snapshot monitor.Snapshot)
IncNotificationQueued(checkIn string, status monitor.EventStatus)
IncNotificationSkipped(checkIn string, status monitor.EventStatus, reason string)
IncNotificationQueueFailed(checkIn string, status monitor.EventStatus)
}
MetricsRecorder records scheduler-owned monitor and notification metrics.
type NotificationRouter ¶ added in v0.0.11
type NotificationRouter interface {
ReceiverIDsForEvent(event monitor.Event) ([]kit.ReceiverID, bool)
}
NotificationRouter chooses explicit notification receivers for monitor events.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler advances a check-in monitor and enqueues lifecycle notifications.
func New ¶
func New( monitor CheckInMonitor, notifier kit.Notifier, router NotificationRouter, registry MetricsRecorder, logger *slog.Logger, ) *Scheduler
New creates a scheduler for a check-in monitor and notifykit manager.
func (*Scheduler) CheckInName ¶
CheckInName returns the configured check-in monitor name.
func (*Scheduler) RecordCheckIn ¶
func (s *Scheduler) RecordCheckIn(at time.Time) monitor.RecordResult
RecordCheckIn records a check-in and enqueues any resolved notification.
func (*Scheduler) RecordCheckInContext ¶ added in v0.0.11
RecordCheckInContext records a check-in and uses ctx when enqueueing any resolved notification.
Click to show internal directories.
Click to hide internal directories.