Versions in this module Expand all Collapse all v1 v1.0.1 Jan 11, 2024 v1.0.0 Jun 1, 2021 Changes in this version + const DescriptorAnnually + const DescriptorDaily + const DescriptorEveryPrefix + const DescriptorHourly + const DescriptorMidnight + const DescriptorMonthly + const DescriptorWeekly + const DescriptorYearly + type Cron interface + Add func(spec string, job Job, opts ...EntryOption) int + AddFunc func(spec string, fn func(), opts ...EntryOption) int + Release func() + Remove func(id int) + Run func() + Stop func() + func New(opts ...Option) Cron + type Entry struct + ID int + Job Job + Next time.Time + Prev time.Time + RunFirst bool + Schedule Schedule + Spec string + Times uint + type EntryOption func(e *Entry) + func WithEntryMaxExecuteTimes(times uint) EntryOption + func WithEntryRunFirst() EntryOption + type EverySchedule struct + Delay time.Duration + func Every(duration time.Duration) *EverySchedule + func (s *EverySchedule) Next(t time.Time) time.Time + type FuncJob func() + func (f FuncJob) Run() + type Heap struct + func (h *Heap) Add(spec string, job Job, opts ...EntryOption) int + func (h *Heap) AddFunc(spec string, fn func(), opts ...EntryOption) int + func (h *Heap) Release() + func (h *Heap) Remove(id int) + func (h *Heap) Run() + func (h *Heap) Stop() + type Job interface + Run func() + type Logger interface + Debug func(format string, params ...interface{}) + Error func(format string, params ...interface{}) + Info func(format string, params ...interface{}) + type Option func(h *Heap) + func WithLocaltime(t time.Time) Option + func WithLogger(l Logger) Option + func WithParser(p Parser) Option + type ParseOption int + const DayOfMonth + const DayOfWeek + const Descriptor + const Hour + const Minute + const Month + const ParseOptionAll + const ParseOptionStandard + const Second + type Parser interface + Parse func(spec string) (Schedule, error) + func NewParser(options ParseOption) Parser + type Schedule interface + Next func(t time.Time) time.Time + type SpecParser struct + func (p *SpecParser) Parse(spec string) (Schedule, error) + type SpecSchedule struct + DayOfMonth uint64 + DayOfWeek uint64 + Hour uint64 + Minute uint64 + Month uint64 + Second uint64 + func (s *SpecSchedule) Next(t time.Time) time.Time + type SpinLock uint32 + func NewSpinLock() *SpinLock + func (sl *SpinLock) Lock() + func (sl *SpinLock) Unlock()