timer

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetHour

func SetHour(hour int) (spec string)

func SetMinute

func SetMinute(minute int) (spec string)

func SetSecond

func SetSecond(second int) (spec string)

func SetSomeTimeOfGet

func SetSomeTimeOfGet(offset int, ams ...string) (spec string)

在某个时间阶段性按间隔执行 参数限制格式如:3-6am,19-23pm

func SetTimeOfDay

func SetTimeOfDay(minute, hour int) (spec string)

设置某个时刻下执行

Types

type MyTimer

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

func NewTimer

func NewTimer() *MyTimer

func (*MyTimer) AddJob

func (t *MyTimer) AddJob(spec string, f ...cron.Job) (err error)

func (*MyTimer) AddTask

func (t *MyTimer) AddTask(spec string, f ...func()) (err error)

func (*MyTimer) Start

func (t *MyTimer) Start()

func (*MyTimer) Stop

func (t *MyTimer) Stop()

Jump to

Keyboard shortcuts

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