Documentation
¶
Index ¶
- func CheckOverlap(range1, range2 string, maxValue int) (bool, error)
- func DaysOverlap(dom1, dow1, dom2, dow2 string) (bool, error)
- func DomOverlap(dom1, dom2 string) (bool, error)
- func DowOverlap(dow1, dow2 string) (bool, error)
- func HoursOverlap(hours1, hours2 string) (bool, error)
- func MonthsOverlap(months1, months2 string) (bool, error)
- func OptionalEnv(name string) string
- func OptionalEnvOrDefault(name, defaultValue string) string
- func ParseRange(input string, maxValue int) (map[int]bool, error)
- func RequireEnv(name string) (string, error)
- func SchedulesOverlap(schedule1, schedule2 string) (bool, error)
- func ValidateSchedules(schedules []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckOverlap ¶ added in v2.6.0
CheckOverlap is a function to check if two ranges overlap
func DaysOverlap ¶ added in v2.6.0
DaysOverlap checks if two day ranges overlap, considering both DOM and DOW. Returns true if both DOM and DOW overlap, or if one is * and the other overlaps.
func DomOverlap ¶ added in v2.6.0
DomOverlap checks if two day-of-month ranges overlap
func DowOverlap ¶ added in v2.6.0
DowOverlap checks if two day-of-week ranges overlap
func HoursOverlap ¶ added in v2.6.0
HoursOverlap checks if two hour ranges overlap
func MonthsOverlap ¶ added in v2.6.0
MonthsOverlap checks if two month ranges overlap
func OptionalEnv ¶
OptionalEnv returns the value for environment variable if it exists, otherwise returns an empty string.
func OptionalEnvOrDefault ¶
OptionalEnvOrDefault returns the value for environment variable if it exists, otherwise returns the default value.
func ParseRange ¶ added in v2.6.0
ParseRange converts a cron range to a set of integers maxValue is the maximum allowed value (e.g., 23 for hours, 6 for DOW, 12 for months, 31 for DOM)
func RequireEnv ¶
RequireEnv requires environment variable to be present. The constraint can be verified only during execution of the workspace build (determined with env `CODER_WORKSPACE_BUILD_ID`).
func SchedulesOverlap ¶ added in v2.6.0
SchedulesOverlap checks if two schedules overlap by checking all cron fields separately
func ValidateSchedules ¶ added in v2.6.0
ValidateSchedules checks if any schedules overlap
Types ¶
This section is empty.