cron

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 6 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 New1 added in v0.0.28

func New1(options ...Option) (d *Cron, cf func())

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 (c *Cron) Start() error

func (*Cron) Stop

func (c *Cron) Stop() error

type EntryID

type EntryID = cron.EntryID

type Job

type Job = cron.Job

type Logger added in v0.0.19

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

func NewLogger added in v0.0.19

func NewLogger(core zapcore.Core, lvl zapcore.Level) *Logger

func (Logger) Enabled added in v0.0.19

func (l Logger) Enabled(lvl zapcore.Level) bool

func (*Logger) Error added in v0.0.19

func (s *Logger) Error(err error, msg string, keysAndValues ...interface{})

Error logs an error condition.

func (*Logger) Info added in v0.0.19

func (s *Logger) Info(msg string, keysAndValues ...interface{})

type Option

type Option func(alc *Cron)

func WithLogLevel added in v0.0.19

func WithLogLevel(lvl zapcore.Level) Option

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