package
0.0.0-20250312152250-ea85ec9d2454
Repository: https://github.com/snapcore/snapd.git
Documentation: pkg.go.dev
# Functions
AfterFunc waits for the duration to elapse and then calls f in its own goroutine.
Human turns the time into a relative expression of time meant for human consumption.
Includes checks whether given time t falls inside the time range covered by a schedule.
IsNTPSynchronized returns true if the time is syncronized according to systemd-timedated.
MockTimeNow mocks the time.Now() calls used in the timeutil package.
NewTimer creates a new Timer that will send the current time on its channel after at least duration d.
Next returns the earliest event after last according to the provided schedule but no later than maxDuration since last.
ParseClock parses a string that contains hour:minute and returns a Clock type or an error.
ParseLegacySchedule takes an obsolete schedule string in the form of:
9:00-15:00 (every day between 9am and 3pm) 9:00-15:00/21:00-22:00 (every day between 9am,5pm and 9pm,10pm)
and returns a list of Schedule types or an error.
ParseSchedule parses a schedule in V2 format.
# Structs
Clock represents a hour:minute time within a day.
ClockSpan represents a time span within 24h, potentially crossing days.
No description provided by the author
Schedule represents a single schedule.
ScheduleWindow represents a time window between Start and End times when the scheduled event can happen.
No description provided by the author
Week represents a weekday such as Monday, Tuesday, with optional week-in-the-month position, eg.
WeekSpan represents a span of weekdays between Start and End days, which may be a single day.
# Interfaces
Timer is an interface which wraps time.Timer so that it may be mocked.