cron

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cron is a minimal standard 5-field cron parser/matcher (minute, hour, day-of-month, month, day-of-week). It supports "*", lists ("a,b"), ranges ("a-b"), and steps ("*/n", "a-b/n") — enough to express the panel's backup schedules without pulling in a dependency. Matching uses Vixie-cron semantics: when both day-of-month and day-of-week are restricted, a tick matches if EITHER does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schedule

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

Schedule is a parsed cron expression. Each field is a bitmask of allowed values.

func Parse

func Parse(expr string) (*Schedule, error)

Parse compiles a 5-field cron expression. It returns an error for the wrong field count or any out-of-range / malformed field.

func (*Schedule) Match

func (s *Schedule) Match(t time.Time) bool

Match reports whether t (already in the desired timezone) satisfies the schedule.

Jump to

Keyboard shortcuts

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