cron

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crontab

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

Crontab crontab manager

func New added in v1.3.0

func New() *Crontab

New crontab

func (*Crontab) AddByFunc

func (c *Crontab) AddByFunc(id string, spec string, f func()) error

AddByFunc add function as crontab task

func (*Crontab) AddByID

func (c *Crontab) AddByID(id string, spec string, cmd cron.Job) error

AddByID add one crontab task id is unique spec is the crontab expression

func (*Crontab) DelByID

func (c *Crontab) DelByID(id string)

DelByID remove one crontab task

func (*Crontab) IDs

func (c *Crontab) IDs() []string

IDs ...

func (*Crontab) IsExists

func (c *Crontab) IsExists(jid string) bool

IsExists check the crontab task whether existed with job id

func (*Crontab) Start

func (c *Crontab) Start()

Start the crontab engine

func (*Crontab) Stop

func (c *Crontab) Stop()

Stop the crontab engine

Jump to

Keyboard shortcuts

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