cron

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScheduleEventAdd    = 1
	ScheduleEventChange = 2
	ScheduleEventRemove = 3
	ScheduleEventResize = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron

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

func NewCron

func NewCron(h Resize, chgBuff int) *Cron

func (*Cron) AddFunc

func (s *Cron) AddFunc(name string, sch schedule.Interface, cmd ScheduleRun)

func (*Cron) AddJob

func (s *Cron) AddJob(name string, sch schedule.Interface, cmd Job)

func (*Cron) AddScheduleJob

func (s *Cron) AddScheduleJob(name string, cmd ScheduleJob)

func (*Cron) Entries

func (s *Cron) Entries() entries

func (*Cron) Entry

func (s *Cron) Entry(name string) *entry

func (*Cron) Job

func (s *Cron) Job(name string) ScheduleJob

func (*Cron) Remove

func (s *Cron) Remove(name string)

func (*Cron) Resize

func (s *Cron) Resize()

func (*Cron) Start

func (s *Cron) Start()

func (*Cron) Stop

func (s *Cron) Stop()

type Job

type Job interface {
	Init()
	Run(time.Time)
	Destroy()
}

type Resize

type Resize interface {
	Check(cap, len int) bool
	NewCap(len int) int
}

type ScheduleJob

type ScheduleJob interface {
	schedule.Interface
	Job
}

type ScheduleRun

type ScheduleRun func(t time.Time)

type WrapJob

type WrapJob ScheduleRun

func (WrapJob) Destroy

func (f WrapJob) Destroy()

func (WrapJob) Init

func (f WrapJob) Init()

func (WrapJob) Run

func (f WrapJob) Run(t time.Time)

type WrapScheduleJob

type WrapScheduleJob struct {
	Job
	schedule.Interface
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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