helpers
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
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¶
funcCheckOverlap¶added inv2.6.0
CheckOverlap is a function to check if two ranges overlap
funcDaysOverlap¶added inv2.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.
funcDomOverlap¶added inv2.6.0
DomOverlap checks if two day-of-month ranges overlap
funcDowOverlap¶added inv2.6.0
DowOverlap checks if two day-of-week ranges overlap
funcHoursOverlap¶added inv2.6.0
HoursOverlap checks if two hour ranges overlap
funcMonthsOverlap¶added inv2.6.0
MonthsOverlap checks if two month ranges overlap
funcOptionalEnv¶
OptionalEnv returns the value for environment variable if it exists,otherwise returns an empty string.
funcOptionalEnvOrDefault¶
OptionalEnvOrDefault returns the value for environment variable if it exists,otherwise returns the default value.
funcParseRange¶added inv2.6.0
ParseRange converts a cron range to a set of integersmaxValue is the maximum allowed value (e.g., 23 for hours, 6 for DOW, 12 for months, 31 for DOM)
funcRequireEnv¶
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`).
funcSchedulesOverlap¶added inv2.6.0
SchedulesOverlap checks if two schedules overlap by checkingall cron fields separately
funcValidateSchedules¶added inv2.6.0
ValidateSchedules checks if any schedules overlap
Types¶
This section is empty.