cron

package
v0.0.0-...-d553e6a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtOnceScheduler

type AtOnceScheduler struct {
	// contains filtered or unexported fields
}

func (*AtOnceScheduler) Done

func (a *AtOnceScheduler) Done() bool

func (*AtOnceScheduler) Next

func (a *AtOnceScheduler) Next(t time.Time) time.Time

type AtScheduler

type AtScheduler struct {
	// contains filtered or unexported fields
}

func (*AtScheduler) Done

func (a *AtScheduler) Done() bool

func (*AtScheduler) Next

func (a *AtScheduler) Next(t time.Time) time.Time

type Cron

type Cron struct {
	// contains filtered or unexported fields
}

func New

func New() *Cron

func (*Cron) Add

func (c *Cron) Add(s Scheduler, j func())

func (*Cron) Start

func (c *Cron) Start()

func (*Cron) Stop

func (c *Cron) Stop()

func (*Cron) Wait

func (c *Cron) Wait()

type Job

type Job struct {
	Scheduler Scheduler
	Callback  JobFunc
	Next      time.Time
	Prev      time.Time
	Active    bool
}

type JobFunc

type JobFunc func()

func (JobFunc) Run

func (j JobFunc) Run()

type PeriodScheduler

type PeriodScheduler struct {
	// contains filtered or unexported fields
}

func (*PeriodScheduler) At

func (a *PeriodScheduler) At(t string) Scheduler

func (*PeriodScheduler) Done

func (p *PeriodScheduler) Done() bool

func (*PeriodScheduler) Next

func (p *PeriodScheduler) Next(t time.Time) time.Time

type Scheduler

type Scheduler interface {
	Next(t time.Time) time.Time
	Done() bool
}

func AtOnce

func AtOnce(t string) Scheduler

func Every

func Every(t time.Duration) Scheduler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL