Documentation ¶
Index ¶
- Constants
- Variables
- type Chain
- type ConstantDelaySchedule
- type Cron
- type CronEntry
- type CronEntryID
- type CronLogger
- type Entry
- func (this *Entry) AddFunc(cmd func()) *Entry
- func (this *Entry) AddJob(cmd IJob) *Entry
- func (this *Entry) AddSchedule(schedule ISchedule, cmd IJob) *Entry
- func (this *Entry) At(time string) *Entry
- func (this *Entry) Cron(spec string) *Entry
- func (this *Entry) CronAnnually() *Entry
- func (this *Entry) CronDaily() *Entry
- func (this *Entry) CronHourly() *Entry
- func (this *Entry) CronMidnight() *Entry
- func (this *Entry) CronMonthly() *Entry
- func (this *Entry) CronWeekly() *Entry
- func (this *Entry) CronYearly() *Entry
- func (this *Entry) Daily() *Entry
- func (this *Entry) DailyAt(time string) *Entry
- func (this *Entry) Days(days ...string) *Entry
- func (this *Entry) Every(date string) *Entry
- func (this *Entry) EveryFifteenMinutes() *Entry
- func (this *Entry) EveryFifteenSeconds() *Entry
- func (this *Entry) EveryFiveMinutes() *Entry
- func (this *Entry) EveryFiveSeconds() *Entry
- func (this *Entry) EveryFourHours() *Entry
- func (this *Entry) EveryFourMinutes() *Entry
- func (this *Entry) EveryFourSeconds() *Entry
- func (this *Entry) EveryMinute() *Entry
- func (this *Entry) EverySecond() *Entry
- func (this *Entry) EverySixHours() *Entry
- func (this *Entry) EveryTenMinutes() *Entry
- func (this *Entry) EveryTenSeconds() *Entry
- func (this *Entry) EveryThirtyMinutes() *Entry
- func (this *Entry) EveryThirtySeconds() *Entry
- func (this *Entry) EveryThreeHours() *Entry
- func (this *Entry) EveryThreeMinutes() *Entry
- func (this *Entry) EveryThreeSeconds() *Entry
- func (this *Entry) EveryTwoHours() *Entry
- func (this *Entry) EveryTwoMinutes() *Entry
- func (this *Entry) EveryTwoSeconds() *Entry
- func (this *Entry) Fridays() *Entry
- func (this *Entry) Hourly() *Entry
- func (this *Entry) HourlyAt(offset ...string) *Entry
- func (this *Entry) Mondays() *Entry
- func (this *Entry) Monthly() *Entry
- func (this *Entry) MonthlyOn(dayOfMonth, time string) *Entry
- func (this *Entry) Quarterly() *Entry
- func (this *Entry) Saturdays() *Entry
- func (this *Entry) SpliceIntoPosition(position uint, value string) *Entry
- func (this *Entry) Sundays() *Entry
- func (this *Entry) Thursdays() *Entry
- func (this *Entry) Tuesdays() *Entry
- func (this *Entry) TwiceDaily(first, second string) *Entry
- func (this *Entry) TwiceDailyAt(first, second, offset string) *Entry
- func (this *Entry) TwiceMonthly(first, second, time string) *Entry
- func (this *Entry) Wednesdays() *Entry
- func (this *Entry) Weekdays() *Entry
- func (this *Entry) Weekends() *Entry
- func (this *Entry) Weekly() *Entry
- func (this *Entry) WeeklyOn(dayOfWeek, time string) *Entry
- func (this *Entry) WithCmd(cmd any) *Entry
- func (this *Entry) WithName(name string) *Entry
- func (this *Entry) WithSpec(spec string) *Entry
- func (this *Entry) Yearly() *Entry
- func (this *Entry) YearlyOn(month, dayOfMonth, time string) *Entry
- type IFuncJob
- type IJob
- type ISchedule
- type JobWrapper
- type Logger
- type Option
- type Parser
- type Schedule
- func (this *Schedule) AddFunc(cmd func()) *Entry
- func (this *Schedule) AddJob(cmd IJob) *Entry
- func (this *Schedule) AddSchedule(schedule ISchedule, cmd IJob) *Entry
- func (this *Schedule) ClearEntries() *Schedule
- func (this *Schedule) CronEntries() []CronEntry
- func (this *Schedule) CronEntry(name string) CronEntry
- func (this *Schedule) CronID(name string) CronEntryID
- func (this *Schedule) CronIDNames() []string
- func (this *Schedule) CronIDs() map[string]CronEntryID
- func (this *Schedule) CronLocation() *time.Location
- func (this *Schedule) CronRemove(name string)
- func (this *Schedule) CronStart(name string)
- func (this *Schedule) CronStop(name string)
- func (this *Schedule) Entries() []*Entry
- func (this *Schedule) GetEntry(name string) *Entry
- func (this *Schedule) RemoveEntry(name string)
- func (this *Schedule) Run()
- func (this *Schedule) SetLocation(loc string) *Schedule
- func (this *Schedule) SetShowLogInfo(logInfo bool) *Schedule
- func (this *Schedule) Start()
- func (this *Schedule) Stop() context.Context
- func (this *Schedule) WithCron(c *Cron) *Schedule
- func (this *Schedule) WithEntry(entry *Entry) *Schedule
- func (this *Schedule) WithOption(opts ...Option) *Schedule
- type SpecSchedule
Constants ¶
View Source
const ( SUNDAY = "0" MONDAY = "1" TUESDAY = "2" WEDNESDAY = "3" THURSDAY = "4" FRIDAY = "5" SATURDAY = "6" )
常量
Variables ¶
View Source
var ( // New NewCron = cron.New // 设置 WithLocation = cron.WithLocation WithSeconds = cron.WithSeconds WithParser = cron.WithParser WithChain = cron.WithChain WithLogger = cron.WithLogger // 解析 NewParser = cron.NewParser ParseStandard = cron.ParseStandard // Chain NewChain = cron.NewChain Recover = cron.Recover DelayIfStillRunning = cron.DelayIfStillRunning SkipIfStillRunning = cron.SkipIfStillRunning // Every Every = cron.Every // 日志 DefaultLogger = cron.DefaultLogger DiscardLogger = cron.DiscardLogger PrintfLogger = cron.PrintfLogger VerbosePrintfLogger = cron.VerbosePrintfLogger )
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { // 计划时间 Spec string // Schedule Schedule ISchedule // 脚本 Cmd any // 当前任务名称 Name string }
*
- 计划任务内容,任务时间用的最低秒 *
- @create 2022-11-29
- @author deatil
func (*Entry) AddSchedule ¶
Schedule
func (*Entry) EveryFifteenMinutes ¶
func (*Entry) EveryFifteenSeconds ¶
func (*Entry) EveryFiveMinutes ¶
func (*Entry) EveryFiveSeconds ¶
func (*Entry) EveryFourHours ¶
func (*Entry) EveryFourMinutes ¶
func (*Entry) EveryFourSeconds ¶
func (*Entry) EveryMinute ¶
func (*Entry) EverySecond ¶
func (*Entry) EverySixHours ¶
func (*Entry) EveryTenMinutes ¶
func (*Entry) EveryTenSeconds ¶
func (*Entry) EveryThirtyMinutes ¶
func (*Entry) EveryThirtySeconds ¶
func (*Entry) EveryThreeHours ¶
func (*Entry) EveryThreeMinutes ¶
func (*Entry) EveryThreeSeconds ¶
func (*Entry) EveryTwoHours ¶
func (*Entry) EveryTwoMinutes ¶
func (*Entry) EveryTwoSeconds ¶
func (*Entry) SpliceIntoPosition ¶
更改位置
func (*Entry) TwiceDaily ¶
func (*Entry) TwiceDailyAt ¶
func (*Entry) TwiceMonthly ¶
func (*Entry) Wednesdays ¶
type Schedule ¶
type Schedule struct { // 计划任务 Cron *Cron // contains filtered or unexported fields }
*
- 计划任务 *
- @create 2022-11-29
- @author deatil
func (*Schedule) AddSchedule ¶
AddSchedule
func (*Schedule) CronEntries ¶ added in v1.0.1002
计划任务已添加任务列表
func (*Schedule) CronID ¶ added in v1.0.1002
func (this *Schedule) CronID(name string) CronEntryID
计划任务单个 ID
func (*Schedule) CronIDNames ¶ added in v1.0.1002
计划任务名称列表
func (*Schedule) CronLocation ¶ added in v1.0.1002
任务时区
func (*Schedule) RemoveEntry ¶ added in v1.0.1002
移除数据
Click to show internal directories.
Click to hide internal directories.