cron

package
v0.0.0-...-3596c24 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DelayTaskManager = NewMemDelayTaskManage()

Functions

func GetDisplayCycleTime

func GetDisplayCycleTime(cycleTime string) []string

GetDisplayCycleTime 获取cronTab转化周期时间

Types

type DelayTask

type DelayTask struct {
	ID             ID
	DealTime       time.Duration // 处理时间
	Data           interface{}
	Fn             func(data interface{})
	CancelCallback func()
	// contains filtered or unexported fields
}

func (*DelayTask) Run

func (g *DelayTask) Run()

type DelayTaskManage

type DelayTaskManage interface {
	Run(*DelayTask) error
	Cancel(ID)
}

func NewMemDelayTaskManage

func NewMemDelayTaskManage() DelayTaskManage

type ID

type ID = string

type Icron

type Icron interface {
	AddJob(spec string, id string, job cron.Job) error
	GetJob(id string) (cron.Job, bool)
	Remove(id string)
	Start()
	Stop()
}

func Get

func Get() Icron

type ScheduleCron

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

func (*ScheduleCron) AddJob

func (s *ScheduleCron) AddJob(spec, id string, job cron.Job) error

func (*ScheduleCron) GetJob

func (s *ScheduleCron) GetJob(id string) (cron.Job, bool)

func (*ScheduleCron) Remove

func (s *ScheduleCron) Remove(id string)

func (*ScheduleCron) Start

func (s *ScheduleCron) Start()

func (*ScheduleCron) Stop

func (s *ScheduleCron) Stop()

Jump to

Keyboard shortcuts

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