xcron

package
v0.0.0-...-b804f52 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MulanPSL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Every ...
	Every = cron.Every
	// NewParser ...
	NewParser = cron.NewParser
	// NewChain ...
	NewChain = cron.NewChain
	// WithSeconds ...
	WithSeconds = cron.WithSeconds
	// WithParser ...
	WithParser = cron.WithParser
	// WithLocation ...
	WithLocation = cron.WithLocation
)

Functions

This section is empty.

Types

type Config

type Config struct {
	WithSeconds     bool
	ConcurrentDelay int
	ImmediatelyRun  bool

	// Distributed task
	DistributedTask bool
	// contains filtered or unexported fields
}

Config ...

func DefaultConfig

func DefaultConfig() Config

type Cron

type Cron struct {
	*Config
	*cron.Cron
}

func Build

func Build(name string) *Cron

Build ...

func (*Cron) AddFunc

func (c *Cron) AddFunc(spec string, cmd func() error, lockExpire time.Duration) (EntryID, error)

func (*Cron) AddJob

func (c *Cron) AddJob(spec string, cmd NamedJob, lockExpire time.Duration) (EntryID, error)

func (*Cron) Run

func (c *Cron) Run() error

func (*Cron) Schedule

func (c *Cron) Schedule(schedule Schedule, job NamedJob, lockExpire time.Duration) EntryID

func (*Cron) Stop

func (c *Cron) Stop() error

func (*Cron) WithRdb

func (c *Cron) WithRdb(rdb *redis.Redis) *Cron

WithRdb distributedTask=true 必须使用

type Entry

type Entry = cron.Entry

Entry ...

type EntryID

type EntryID = cron.EntryID

EntryID ...

type FuncJob

type FuncJob func() error

func (FuncJob) Name

func (f FuncJob) Name() string

func (FuncJob) Run

func (f FuncJob) Run() error

type Job

type Job = cron.Job

Job ...

type JobWrapper

type JobWrapper = cron.JobWrapper

JobWrapper ...

type NamedJob

type NamedJob interface {
	Run() error
	Name() string
}

NamedJob ..

type Option

type Option = cron.Option

Option ...

type Parser

type Parser = cron.Parser

Parser ...

type Schedule

type Schedule = cron.Schedule

Schedule ...

Jump to

Keyboard shortcuts

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