cron

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler struct {
	*cron.Cron
}

Scheduler is a cron-like job scheduler.

func NewScheduler

func NewScheduler(ctx context.Context) *Scheduler

NewScheduler returns a new Cron.

func (*Scheduler) AddFunc

func (s *Scheduler) AddFunc(spec string, fn func()) (int, error)

AddFunc adds a job to the Scheduler.

func (*Scheduler) Remove

func (s *Scheduler) Remove(id int)

Remove removes a job from the Scheduler.

func (*Scheduler) Shutdown

func (s *Scheduler) Shutdown()

Shutdonw gracefully shuts down the Scheduler.

func (*Scheduler) Start

func (s *Scheduler) Start()

Start starts the Scheduler.

Jump to

Keyboard shortcuts

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