cronman

package
v2.2.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 8 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronJobTimerHeap

type CronJobTimerHeap []*SCronJob

func (CronJobTimerHeap) Len

func (cjth CronJobTimerHeap) Len() int

func (CronJobTimerHeap) Less

func (cjth CronJobTimerHeap) Less(i, j int) bool

func (*CronJobTimerHeap) Pop

func (cjth *CronJobTimerHeap) Pop() interface{}

func (*CronJobTimerHeap) Push

func (cjth *CronJobTimerHeap) Push(x interface{})

func (CronJobTimerHeap) Swap

func (cjth CronJobTimerHeap) Swap(i, j int)

type ICronTimer

type ICronTimer interface {
	Next(time.Time) time.Time
}

type SCronJob

type SCronJob struct {
	Name string

	Timer ICronTimer
	Next  time.Time
	// contains filtered or unexported fields
}

type SCronJobManager

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

func GetCronJobManager

func GetCronJobManager() *SCronJobManager

func (*SCronJobManager) AddJob1

func (self *SCronJobManager) AddJob1(name string, interval time.Duration, jobFunc func(ctx context.Context, userCred mcclient.TokenCredential))

func (*SCronJobManager) AddJob2

func (self *SCronJobManager) AddJob2(name string, day, hour, min, sec int, jobFunc func(ctx context.Context, userCred mcclient.TokenCredential))

func (*SCronJobManager) Next

func (self *SCronJobManager) Next(now time.Time)

func (*SCronJobManager) Start

func (self *SCronJobManager) Start()

func (*SCronJobManager) Stop

func (self *SCronJobManager) Stop()

type Timer1

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

func (*Timer1) Next

func (t *Timer1) Next(now time.Time) time.Time

type Timer2

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

func (*Timer2) Next

func (t *Timer2) Next(now time.Time) time.Time

Jump to

Keyboard shortcuts

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