crontab

package module
v0.0.0-...-c977de9 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crontab

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

Crontab 定时任务实现

func New

func New(logger *zap.Logger) *Crontab

New 实例化crontab实例

func (*Crontab) Register

func (c *Crontab) Register(spec string, command contract.Command)

Register 注册定时任务类

  • @param spec string 定时规则:`Second | Minute | Hour | Dom (day of month) | Month | Dow (day of week)`
  • @param command contract.Command 任务类需实现命令契约,并且传递结构体实例的指针

func (*Crontab) Shutdown

func (c *Crontab) Shutdown()

Shutdown 优雅停止定时任务守护进程

func (*Crontab) Start

func (c *Crontab) Start()

Start 启动定时任务守护进程

Jump to

Keyboard shortcuts

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