Documentation
¶
Overview ¶
Package application holds the digest use cases — the stuck-PR reporter and the cron scheduler — behind the domain's use-case interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter builds and posts the stuck-PR digest for every channel that owns at least one stuck PR. It is the application's DigestReporter and, via ReportSchedule, its ScheduleJob.
func NewReporter ¶
func NewReporter(params domain.ReporterParams) *Reporter
NewReporter constructs a Reporter from its params. Now defaults to time.Now and TZ to UTC when unset.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler runs one cron per distinct schedule spec, calling its job for each tick with the matching spec. It mirrors the maintenance cleaner's Run(ctx) shape so the composition root can start both the same way.
func NewScheduler ¶
func NewScheduler(params domain.SchedulerParams) (*Scheduler, error)
NewScheduler validates every cron spec up front so a malformed schedule fails fast at startup rather than silently never firing. Specs is a list of standard 5-field cron expressions (e.g. ["0 9 * * *", "0 18 * * *"]); TZ is the timezone every spec is interpreted in (nil defaults to UTC).