cron

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonResize added in v0.2.2

type CommonResize struct {
	CheckTime uint8

	TickerQueueIdleLimit int
	// contains filtered or unexported fields
}

func NewCommonResize added in v0.2.2

func NewCommonResize(gap uint8) *CommonResize

func (*CommonResize) Check added in v0.2.2

func (r *CommonResize) Check(c, l int) bool

func (*CommonResize) NewCap added in v0.2.2

func (r *CommonResize) NewCap(l int) int

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) ResizeMap added in v0.2.2

func (s *Cron) ResizeMap()

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(maxCap, 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