schedexpr

package
v0.0.0-...-a99bcb5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: OSL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package schedexpr parses the schedule expressions the deployment's scheduler uses to trigger recommendation collection and works out when the next run fires (issue #756).

Three syntaxes are accepted, matching what the Terraform modules hand to their schedulers:

  • EventBridge rate expressions, e.g. "rate(1 day)" (AWS Lambda/Fargate);
  • EventBridge cron expressions with six fields, e.g. "cron(0 2 * * ? *)" (AWS Lambda/Fargate);
  • standard five-field cron, e.g. "0 2 * * *" (GCP Cloud Scheduler, Kubernetes CronJobs, the Azure Logic App recurrence).

Every scheduler involved evaluates its schedule in UTC, so Next works in UTC. The parser is deliberately strict: anything it does not fully understand is an error, and callers report "unknown" instead of a wrong time.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("empty schedule expression")

ErrEmpty is returned by Parse for an empty or blank expression, which the deployment uses to mean "scheduled collection is disabled".

Functions

This section is empty.

Types

type Schedule

type Schedule interface {
	// Next returns the first fire time strictly after t, in UTC. ok is
	// false when the fire time cannot be known from the expression alone
	// (rate expressions) or no fire time exists within the search horizon.
	Next(t time.Time) (next time.Time, ok bool)
}

Schedule is a parsed schedule expression.

func Parse

func Parse(expr string) (Schedule, error)

Parse parses expr in any of the supported syntaxes.

Jump to

Keyboard shortcuts

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