Help us shape the future of Go! Take the 2026 Go Developer Survey

cron

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cron provides some cron utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(spec string) (cron.Schedule, error)

Parse parses job specification.

Types

type Cron

type Cron struct {
	*cron.Cron
}

Cron wraps `cron.Cron`.

func New

func New() *Cron

New returns an instance of Cron.

func (*Cron) AddJob

func (c *Cron) AddJob(name, spec string, cmd FuncJob) error

AddJob removes the job with the same name first and adds a new job.

func (*Cron) HasJob added in v0.1.0

func (c *Cron) HasJob(name string) bool

HasJob returns whether the given job exists.

func (*Cron) RemoveJob

func (c *Cron) RemoveJob(name string)

RemoveJob remove the job with the given name.

type FuncJob

type FuncJob cron.FuncJob

FuncJob is alias of `cron.FuncJob`.

Jump to

Keyboard shortcuts

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