crontab

package
v2.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Minute
	SpecEveryMinute = "* * * * *"
	SpecEvery5Min   = "*/5 * * * *"
	SpecEvery10Min  = "*/10 * * * *"
	SpecEvery15Min  = "*/15 * * * *"
	SpecEvery30Min  = "*/30 * * * *"
	SpecEvery45Min  = "*/45 * * * *"

	// Hour
	SpecEveryHour   = "0 * * * *"
	SpecEvery3Hour  = "0 */3 * * *"
	SpecEvery6Hour  = "0 */6 * * *"
	SpecEvery12Hour = "0 */12 * * *"

	// Day
	SpecEveryDay       = "0 0 * * *"
	SpecEverySunday    = "0 0 * * 0"
	SpecEveryMonday    = "0 0 * * 1"
	SpecEveryTuesday   = "0 0 * * 2"
	SpecEveryWednesday = "0 0 * * 3"
	SpecEveryThursday  = "0 0 * * 4"
	SpecEveryFriday    = "0 0 * * 5"
	SpecEverySaturday  = "0 0 * * 6"
	SpecEveryWeekDay   = "0 0 * * 1-5"
	SpecEveryWeekEnd   = "0 0 * * 0,6"

	// Time
	SpecEveryMidnight = SpecEveryDay
	SpecEveryMidday   = "0 12 * * *"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService() Service

func (*Service) AddFunc

func (s *Service) AddFunc(spec string, cmd func()) (cron.EntryID, error)

func (*Service) AddJob

func (s *Service) AddJob(spec string, cmd cron.Job) (cron.EntryID, error)

func (*Service) GetEntryJob

func (s *Service) GetEntryJob(entryId int) cron.Entry

func (*Service) GetEntryJobs

func (s *Service) GetEntryJobs() []cron.Entry

func (*Service) RemoveJob

func (s *Service) RemoveJob(entryId int)

func (*Service) Start

func (s *Service) Start()

func (*Service) Stop

func (s *Service) Stop()

Jump to

Keyboard shortcuts

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