schedule

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImmediateCron

type ImmediateCron struct{}

ImmediateCron is cronLike implementation for test purposes it will execute job imeediately after it has been added

func (*ImmediateCron) AddJob

func (i *ImmediateCron) AddJob(spec string, cmd cron.Job) (cron.EntryID, error)

AddJob implement cronLike interface

func (*ImmediateCron) Entries

func (i *ImmediateCron) Entries() []cron.Entry

Entries implement cronLike interface

func (*ImmediateCron) Remove

func (i *ImmediateCron) Remove(id cron.EntryID)

Remove implement cronLike interface

func (*ImmediateCron) Start

func (i *ImmediateCron) Start()

Start implement cronLike interface

func (*ImmediateCron) Stop

func (i *ImmediateCron) Stop() context.Context

Stop implement cronLike interface

type SimpleScheduler

type SimpleScheduler struct {
	Database storage.DatabaseManager
	Cache    storage.CacheManager
	Registry *core.ScriptRegistry
	Cron     cronLike
	Logger   *logrus.Logger
}

SimpleScheduler is implementation of JobScheduler with cron scheduler it will run jobs and save their results and statuses

func (*SimpleScheduler) AddJob

func (s *SimpleScheduler) AddJob(description core.JobDescription) error

AddJob implements JobScheduler interface

func (*SimpleScheduler) DeleteJob

func (s *SimpleScheduler) DeleteJob(jobID string) error

DeleteJob implements JobScheduler interface

func (*SimpleScheduler) ListNext

func (s *SimpleScheduler) ListNext(jobID string) map[string]core.HTime

ListNext implements JobScheduler interface

func (*SimpleScheduler) Start

func (s *SimpleScheduler) Start()

Start implements JobScheduler interface

func (*SimpleScheduler) Stop

func (s *SimpleScheduler) Stop()

Stop implements JobScheduler interface

Jump to

Keyboard shortcuts

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