schedule

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package schedule triggers configured scans on their cron schedules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Next

func Next(expr string, t time.Time) time.Time

Next returns the next activation of expr after t, or the zero time.

func Validate

func Validate(expr string) error

Validate checks a cron expression. Empty means "no schedule".

Types

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

Scheduler enqueues runs of scheduled scans.

func New

func New(st *store.Store, r *runner.Runner, loc *time.Location, log *slog.Logger) *Scheduler

New returns a scheduler using loc for expressions without CRON_TZ.

func (*Scheduler) NextRun

func (s *Scheduler) NextRun(scanID int64) time.Time

NextRun returns the next scheduled run of a scan, or the zero time.

func (*Scheduler) Start

func (s *Scheduler) Start()

Start starts the scheduler; Stop stops it.

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop stops the scheduler and waits for running triggers.

func (*Scheduler) Sync

func (s *Scheduler) Sync(ctx context.Context) error

Sync reloads all scans from the store. Call it after every change.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL