cron

package module
v0.0.0-...-99f0330 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 7 Imported by: 0

README

leo-cron

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(l log.Logger) cron.Logger

Types

type Job

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

func NewJob

func NewJob(name, spec string, cmd cron.FuncJob) *Job

func (*Job) EntryID

func (job *Job) EntryID() cron.EntryID

func (*Job) Name

func (job *Job) Name() string

func (*Job) Next

func (job *Job) Next() time.Time

Next time the job will run, or the zero time if Cron has not been started or this entry's schedule is unsatisfiable

func (*Job) Prev

func (job *Job) Prev() time.Time

Prev is the last time this job was run, or the zero time if never.

func (*Job) Spec

func (job *Job) Spec() string

func (*Job) Stop

func (job *Job) Stop()

Stop 停止一个Job

type Option

type Option func(*options)

func Location

func Location(location *time.Location) Option

Location 时区

func Logger

func Logger(logger log.Logger) Option

func Middleware

func Middleware(mdw ...cron.JobWrapper) Option

func Parser

func Parser(p cron.ScheduleParser) Option

func Seconds

func Seconds() Option

type Task

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

func New

func New(jobs []*Job, opts ...Option) *Task

func (*Task) Jobs

func (task *Task) Jobs() []*Job

func (*Task) Start

func (task *Task) Start(_ context.Context) error

func (*Task) Stop

func (task *Task) Stop(_ context.Context) error

func (*Task) String

func (task *Task) String() string

Jump to

Keyboard shortcuts

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