cron

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 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 ConsumeHandle

type ConsumeHandle func(ctx context.Context) error

type Cron

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

func New

func New(options ...Option) (d *Cron)

New 新cron

func (*Cron) AddFunc

func (c *Cron) AddFunc(spec string, cmd func()) (EntryID, error)

func (*Cron) AddJob

func (c *Cron) AddJob(spec string, cmd Job) (EntryID, error)

func (*Cron) Remove

func (c *Cron) Remove(id EntryID)

func (*Cron) Start

func (s *Cron) Start() error

func (*Cron) Stop

func (s *Cron) Stop() error

type EntryID

type EntryID = cron.EntryID

type Job

type Job = cron.Job

type Option

type Option func(alc *Cron)

func WithSpec

func WithSpec(spec string, handler ConsumeHandle) Option

type Pair

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

Jump to

Keyboard shortcuts

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