cron

package
v0.0.0-...-bd2d25b Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron

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

func New

func New(opts *Opts) *Cron

func (*Cron) Register

func (c *Cron) Register(name string, cronTab string, fn JobFunc)

func (*Cron) Run

func (c *Cron) Run()

type JobFunc

type JobFunc func() error

JobFunc function signature for job functions

type Opts

type Opts struct {
	// enable distributed lock in cluster nodes.
	// True: only one instance can execute.
	// False: multiple instances can execute, not preferable for multiple instances.
	DistLockEnable bool
}

Jump to

Keyboard shortcuts

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