scheduler

package
v0.0.0-...-8d49010 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 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 Job

type Job struct {
	// 任务名称
	Name string
	// 执行间隔
	Interval time.Duration
	// 下次执行时间
	Next time.Time
	// 上次执行时间
	Prev time.Time
	// 执行函数
	CMD func()
}

type Scheduler

type Scheduler struct {

	// 日志
	Logs logr.Logger
	// contains filtered or unexported fields
}

func NewScheduler

func NewScheduler() *Scheduler

func (*Scheduler) AddJob

func (s *Scheduler) AddJob(j *Job) error

func (*Scheduler) ListJob

func (s *Scheduler) ListJob() []Job

func (*Scheduler) Start

func (s *Scheduler) Start()

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Jump to

Keyboard shortcuts

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