schedule

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start()

func StartSchedules

func StartSchedules()

开始执行任务

Types

type TimerData

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

func NewSchedule

func NewSchedule(handler func()) *TimerData

设置定时任务

func (*TimerData) DailyAt

func (t *TimerData) DailyAt(hour int, minute int)

每天的x时x分

  • hour: [0, 23]
  • minute: [0,59]

func (*TimerData) EveryFiveMinutes

func (t *TimerData) EveryFiveMinutes()

每五分钟

func (*TimerData) EveryMinute

func (t *TimerData) EveryMinute()

每分钟

func (*TimerData) EveryTenMinutes

func (t *TimerData) EveryTenMinutes()

每十分钟

func (*TimerData) EveryThirtyMinutes

func (t *TimerData) EveryThirtyMinutes()

每半小时

func (*TimerData) HourlyAt

func (t *TimerData) HourlyAt(minute int)

每小时的x分

  • minute: [0,59]

func (*TimerData) MonthlyAt

func (t *TimerData) MonthlyAt(day int, hour int, minute int)

每月的x日x时x分

  • day: [1,31]
  • hour: [0, 23]
  • minute: [0,59]

func (*TimerData) SetRepeat

func (t *TimerData) SetRepeat(repeat bool) *TimerData

设置是否重复,默认不重复,如果不重复的话,在周期内该函数尚未执行完毕,则此周期就不再执行

func (*TimerData) WeeklyAt

func (t *TimerData) WeeklyAt(week int, hour int, minute int)

每周的星期几x时x分

  • week: [0,6] (0表示星期天)
  • hour: [0, 23]
  • minute: [0,59]

func (*TimerData) YearlyAt

func (t *TimerData) YearlyAt(month int, day int, hour int, minute int)

每年的x月x日x时x分

  • month: [1,12]
  • day: [1,31]
  • hour: [0, 23]
  • minute: [0,59]

Jump to

Keyboard shortcuts

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