crontab

package
v0.0.0-...-2186419 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 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 Crontab

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

Crontab crontab manager

func NewCrontab

func NewCrontab() *Crontab

NewCrontab 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 start the crontab engine

func (*Crontab) Stop

func (c *Crontab) Stop()

Stop stop the crontab engine

Jump to

Keyboard shortcuts

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