cron

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron

type Cron struct {
	*cron.Cron
	// contains filtered or unexported fields
}

func NewCron

func NewCron(name string, l logger.Logger, options ...Option) (c *Cron, err error)

func (*Cron) AddJob

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

func (*Cron) Name

func (c *Cron) Name() string

func (*Cron) Start

func (c *Cron) Start()

func (*Cron) Stop

func (c *Cron) Stop()

type FuncJob

type FuncJob func()

func (FuncJob) Function

func (f FuncJob) Function() func()

func (FuncJob) FunctionName

func (f FuncJob) FunctionName() string

func (FuncJob) Run

func (f FuncJob) Run()

type Option

type Option func(*Options)

func WithErrCallback

func WithErrCallback(f func(error)) Option

func WithLockFormat

func WithLockFormat(lockFormat string) Option

func WithLocker

func WithLocker(l lock.Locker) Option

func WithMiniLockTTL

func WithMiniLockTTL(ttl time.Duration) Option

type Options

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

Jump to

Keyboard shortcuts

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