MCPcopy Index your code
hub / github.com/coder/coder / Daily

Function Daily

coderd/schedule/cron/cron.go:66–72  ·  view source on GitHub ↗

Daily parses a Schedule from spec scoped to a recurring daily event. Spec consists of the following space-delimited fields, in the following order: - timezone e.g. CRON_TZ=US/Central (optional) - minutes of hour e.g. 30 (required) - hour of day e.g. 9 (required) - day of month (must be *) - month (m

(raw string)

Source from the content-addressed store, hash-verified

64// fmt.Println(sched.Next(time.Now()).Format(time.RFC3339))
65// // Output: 2022-04-04T14:30:00Z
66func Daily(raw string) (*Schedule, error) {
67 if err := validateDailySpec(raw); err != nil {
68 return nil, xerrors.Errorf("validate daily schedule: %w", err)
69 }
70
71 return parse(raw)
72}
73
74// TimeRange parses a Schedule from a cron specification interpreted as a continuous time range.
75//

Callers 4

TestCompleteJobFunction · 0.92
TestCalculateAutoStopFunction · 0.92
TestUserQuietHoursFunction · 0.92
parseScheduleMethod · 0.92

Calls 3

validateDailySpecFunction · 0.85
parseFunction · 0.70
ErrorfMethod · 0.45

Tested by 3

TestCompleteJobFunction · 0.74
TestCalculateAutoStopFunction · 0.74
TestUserQuietHoursFunction · 0.74