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

Function Weekly

coderd/schedule/cron/cron.go:40–46  ·  view source on GitHub ↗

Weekly parses a Schedule from spec scoped to a recurring weekly 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

(raw string)

Source from the content-addressed store, hash-verified

38// fmt.Println(sched.Next(time.Now()).Format(time.RFC3339))
39// // Output: 2022-04-04T14:30:00Z
40func Weekly(raw string) (*Schedule, error) {
41 if err := validateWeeklySpec(raw); err != nil {
42 return nil, xerrors.Errorf("validate weekly schedule: %w", err)
43 }
44
45 return parse(raw)
46}
47
48// Daily parses a Schedule from spec scoped to a recurring daily event.
49// Spec consists of the following space-delimited fields, in the following order:

Callers 15

mustScheduleFunction · 0.92
validWorkspaceScheduleFunction · 0.92
mustScheduleFunction · 0.92
NextAutostartFunction · 0.92
Test_WeeklyFunction · 0.92
TestIsWithinRangeFunction · 0.92
TestScheduleShowFunction · 0.92
TestScheduleModifyFunction · 0.92
TestScheduleOverrideFunction · 0.92
parseCLIScheduleFunction · 0.92

Calls 3

validateWeeklySpecFunction · 0.85
parseFunction · 0.70
ErrorfMethod · 0.45

Tested by 13

mustScheduleFunction · 0.74
mustScheduleFunction · 0.74
Test_WeeklyFunction · 0.74
TestIsWithinRangeFunction · 0.74
TestScheduleShowFunction · 0.74
TestScheduleModifyFunction · 0.74
TestScheduleOverrideFunction · 0.74
TestWorkspaceAutobuildFunction · 0.74
TestPrebuildsAutobuildFunction · 0.74