time

package
v0.0.0-...-237f4c2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CronUuidReparatorLeg       int           = 8
	CronUuidStandardLength     int           = 40
	CronTabDefaultPurgeTimeout time.Duration = 60 * time.Second
)

Functions

This section is empty.

Types

type CronData

type CronData struct {
	Delay         time.Duration
	Interval      time.Duration
	NumExecutions int64
	Since         time.Time
}

type CronJob

type CronJob interface {
	Label() string
	Start() error
	Stop() error
	IsRunning() bool
	Update(data CronData) error
	LastRun() time.Time
	Equals(job CronJob) bool
	Id() CronUUID
	String() string
	Report() string
}

func NewCronJob

func NewCronJob(label string, task func(), time CronData, logger log.Logger) CronJob

type CronTab

type CronTab interface {
	AddJob(job CronJob) bool
	RemoveJob(uuid CronUUID) bool
	ListJobs() []CronJob
	Start() error
	Stop() error
	IsRunning() bool
	StartAllJobs() bool
	KillAllJobs() bool
	Purge() bool
	Equals(tab CronTab) bool
	Id() CronUUID
	String() string
	Report() string
}

func NewCronTab

func NewCronTab(label string, logger log.Logger) CronTab

type CronUUID

type CronUUID string

func GenerateCronId

func GenerateCronId() CronUUID

Generate a Cron eleemnt unique id of given length

Jump to

Keyboard shortcuts

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