schedule

package
v0.0.0-...-c59559d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronScheduler

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

func NewCronScheduler

func NewCronScheduler(logger *log.Logger) *CronScheduler

func (*CronScheduler) AddEntry

func (c *CronScheduler) AddEntry(id EntryID, spec string, executor Executor) error

func (*CronScheduler) RemoveEntry

func (c *CronScheduler) RemoveEntry(id EntryID)

func (*CronScheduler) Start

func (c *CronScheduler) Start()

func (*CronScheduler) Stop

func (c *CronScheduler) Stop()

Stop stops CronScheduler Start should always be called before this Blocks until it really stops

func (*CronScheduler) ValidateSpec

func (c *CronScheduler) ValidateSpec(spec string) error

type Entry

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

type EntryID

type EntryID int

type Executor

type Executor func(EntryID)

type MockScheduler

type MockScheduler struct {
}

func (*MockScheduler) AddEntry

func (s *MockScheduler) AddEntry(id EntryID, spec string, executor Executor) error

func (*MockScheduler) RemoveEntry

func (s *MockScheduler) RemoveEntry(id EntryID)

func (*MockScheduler) ValidateSpec

func (s *MockScheduler) ValidateSpec(spec string) error

type Scheduler

type Scheduler interface {
	AddEntry(id EntryID, spec string, executor Executor) error
	RemoveEntry(id EntryID)
	ValidateSpec(spec string) error
}

Jump to

Keyboard shortcuts

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