package
0.0.0-20240918081624-c908e9e5a282
Repository: https://github.com/go-sohunjug/utils.git
Documentation: pkg.go.dev
# Functions
DelayIfStillRunning serializes jobs, delaying subsequent runs until the previous one is complete.
Every returns a crontab Schedule that activates once every duration.
New returns a new Cron job runner, modified by the given options.
NewChain returns a Chain consisting of the given JobWrappers.
NewParser creates a Parser with custom options.
No description provided by the author
ParseStandard returns a new crontab schedule representing the given standardSpec (https://en.wikipedia.org/wiki/Cron).
PrintfLogger wraps a Printf-based logger (such as the standard library "log") into an implementation of the Logger interface which logs errors only.
Recover panics in wrapped jobs and log them with the provided logger.
SkipIfStillRunning skips an invocation of the Job if a previous invocation is still running.
VerbosePrintfLogger wraps a Printf-based logger (such as the standard library "log") into an implementation of the Logger interface which logs everything.
WithChain specifies Job wrappers to apply to all jobs added to this cron.
WithLocation overrides the timezone of the cron instance.
WithLogger uses the provided logger.
WithParser overrides the parser used for interpreting job schedules.
WithSeconds overrides the parser used for interpreting job schedules to include a seconds field as the first one.
# Constants
Allow descriptors such as @monthly, @weekly, etc.
Day of month field, default *.
Day of week field, default *.
Optional day of week field, default *.
Hours field, default 0.
Minutes field, default 0.
Month field, default *.
Seconds field, default 0.
Optional seconds field, default 0.
# Variables
DefaultLogger is used by Cron if none is specified.
DiscardLogger can be used by callers to discard all log messages.
# Structs
Chain is a sequence of JobWrappers that decorates submitted jobs with cross-cutting behaviors like logging or synchronization.
ConstantDelaySchedule represents a simple recurring duty cycle, e.g.
Cron keeps track of any number of entries, invoking the associated func as specified by the schedule.
Entry consists of a schedule and the func to execute on that schedule.
FuncJob is a wrapper that turns a func() into a cron.Job.
No description provided by the author
A custom Parser that can be configured.
SpecSchedule specifies a duty cycle (to the second granularity), based on a traditional crontab specification.
# Interfaces
Job is an interface for submitted cron jobs.
Logger is the interface used in this package for logging, so that any backend can be plugged in.
Schedule describes a job's duty cycle.
ScheduleParser is an interface for schedule spec parsers that return a Schedule.
# Type aliases
EntryID identifies an entry within a Cron instance.
JobWrapper decorates the given Job with some behavior.
Option represents a modification to the default behavior of a Cron.
Configuration options for creating a parser.