cron

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package cron is a generated GoMock package.

Index

Constants

View Source
const (
	POS_SECOND = iota
	POS_MINUTE
	POS_HOUR
	POS_DAY_OF_MONTH
	POS_MONTH
	POS_DAY_OF_WEEK
)
View Source
const (
	SUNDAY = iota
	MONDAY
	TUESDAY
	WEDNESDAY
	THURSDAY
	FRIDAY
	SATURDAY
)

Variables

Functions

This section is empty.

Types

type Command

type Command interface {
	//Name 名称
	Name() string
	//Func 方法
	Func() func()
	//Expression cron 表达式: "* * * * * *"
	Expression() string
	//Cron 自定义 expression "* * * * * *"
	Cron(expression string) Command
	//EverySecond 每 1 秒
	EverySecond() Command
	//EveryTwoSeconds 每 2 秒
	EveryTwoSeconds() Command
	//EveryThreeSeconds 每 3 秒
	EveryThreeSeconds() Command
	//EveryFourSeconds 每 4 秒
	EveryFourSeconds() Command
	//EveryFiveSeconds 每 5 秒
	EveryFiveSeconds() Command
	//EveryTenSeconds 每 10 秒
	EveryTenSeconds() Command
	//EveryFifteenSeconds 每 15 秒
	EveryFifteenSeconds() Command
	//EveryThirtySeconds 每 30 秒
	EveryThirtySeconds() Command
	//EveryMinute 每分钟
	EveryMinute() Command
	//EveryTwoMinutes 每 2 分钟
	EveryTwoMinutes() Command
	//EveryThreeMinutes 每 3 分钟
	EveryThreeMinutes() Command
	//EveryFourMinutes 每 4 分钟
	EveryFourMinutes() Command
	//EveryFiveMinutes 每 5 分钟
	EveryFiveMinutes() Command
	//EveryTenMinutes 每 10 分钟
	EveryTenMinutes() Command
	//EveryFifteenMinutes 每 15 分钟
	EveryFifteenMinutes() Command
	//EveryThirtyMinutes 每 30 分钟
	EveryThirtyMinutes() Command
	//Hourly 每小时
	Hourly() Command
	//HourlyAt 每小时的第几分钟
	HourlyAt([]int) Command
	//EveryTwoHours 每 2 小时
	EveryTwoHours() Command
	//EveryThreeHours 每 3 小时
	EveryThreeHours() Command
	//EveryFourHours 每 4 小时
	EveryFourHours() Command
	//EverySixHours 每 6 小时
	EverySixHours() Command
	//Daily 每天
	Daily() Command
	//DailyAt 每天几点(time: "2:00")
	DailyAt(time string) Command
	//At alias of DailyAt
	At(string) Command
	//Weekdays 工作日 1-5
	Weekdays() Command
	//Weekends 周末
	Weekends() Command
	//Mondays 周一
	Mondays() Command
	//Tuesdays 周二
	Tuesdays() Command
	//Wednesdays 周三
	Wednesdays() Command
	//Thursdays 周四
	Thursdays() Command
	//Fridays 周五
	Fridays() Command
	//Saturdays 周六
	Saturdays() Command
	//Sundays 周日
	Sundays() Command
	//Weekly 每周一
	Weekly() Command
	//WeeklyOn 周日几(day) 几点(time: "0:0")
	WeeklyOn(day int, time string) Command
	Monthly() Command
	// MonthlyOn dayOfMonth: 1, time: "0:0"
	MonthlyOn(dayOfMonth string, time string) Command
	//LastDayOfMonth 每月最后一天
	LastDayOfMonth(time string) Command
	// Quarterly 每季度执行
	Quarterly() Command
	// QuarterlyOn 每季度的第几天,几点(time: "0:0")执行
	QuarterlyOn(dayOfQuarter string, time string) Command
	//Yearly 每年
	Yearly() Command
	//YearlyOn 每年几月(month) 哪天(dayOfMonth) 时间(time: "0:0")
	YearlyOn(month string, dayOfMonth string, time string) Command
	//Days 天(0-6: 周日-周六)
	Days([]int) Command
}

type Manager

type Manager interface {
	NewCommand(name string, fn func() error) Command
	Run(context.Context) error
	Shutdown(context.Context) error
	List() []Command
}

func NewManager

func NewManager(runner Runner, locker locker.Locker, logger mlog.Logger) Manager

type MockCommand

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

MockCommand is a mock of Command interface.

func NewMockCommand

func NewMockCommand(ctrl *gomock.Controller) *MockCommand

NewMockCommand creates a new mock instance.

func (*MockCommand) At

func (m *MockCommand) At(arg0 string) Command

At mocks base method.

func (*MockCommand) Cron

func (m *MockCommand) Cron(arg0 string) Command

Cron mocks base method.

func (*MockCommand) Daily

func (m *MockCommand) Daily() Command

Daily mocks base method.

func (*MockCommand) DailyAt

func (m *MockCommand) DailyAt(arg0 string) Command

DailyAt mocks base method.

func (*MockCommand) Days

func (m *MockCommand) Days(arg0 []int) Command

Days mocks base method.

func (*MockCommand) EXPECT

func (m *MockCommand) EXPECT() *MockCommandMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCommand) EveryFifteenMinutes

func (m *MockCommand) EveryFifteenMinutes() Command

EveryFifteenMinutes mocks base method.

func (*MockCommand) EveryFifteenSeconds

func (m *MockCommand) EveryFifteenSeconds() Command

EveryFifteenSeconds mocks base method.

func (*MockCommand) EveryFiveMinutes

func (m *MockCommand) EveryFiveMinutes() Command

EveryFiveMinutes mocks base method.

func (*MockCommand) EveryFiveSeconds

func (m *MockCommand) EveryFiveSeconds() Command

EveryFiveSeconds mocks base method.

func (*MockCommand) EveryFourHours

func (m *MockCommand) EveryFourHours() Command

EveryFourHours mocks base method.

func (*MockCommand) EveryFourMinutes

func (m *MockCommand) EveryFourMinutes() Command

EveryFourMinutes mocks base method.

func (*MockCommand) EveryFourSeconds

func (m *MockCommand) EveryFourSeconds() Command

EveryFourSeconds mocks base method.

func (*MockCommand) EveryMinute

func (m *MockCommand) EveryMinute() Command

EveryMinute mocks base method.

func (*MockCommand) EverySecond

func (m *MockCommand) EverySecond() Command

EverySecond mocks base method.

func (*MockCommand) EverySixHours

func (m *MockCommand) EverySixHours() Command

EverySixHours mocks base method.

func (*MockCommand) EveryTenMinutes

func (m *MockCommand) EveryTenMinutes() Command

EveryTenMinutes mocks base method.

func (*MockCommand) EveryTenSeconds

func (m *MockCommand) EveryTenSeconds() Command

EveryTenSeconds mocks base method.

func (*MockCommand) EveryThirtyMinutes

func (m *MockCommand) EveryThirtyMinutes() Command

EveryThirtyMinutes mocks base method.

func (*MockCommand) EveryThirtySeconds

func (m *MockCommand) EveryThirtySeconds() Command

EveryThirtySeconds mocks base method.

func (*MockCommand) EveryThreeHours

func (m *MockCommand) EveryThreeHours() Command

EveryThreeHours mocks base method.

func (*MockCommand) EveryThreeMinutes

func (m *MockCommand) EveryThreeMinutes() Command

EveryThreeMinutes mocks base method.

func (*MockCommand) EveryThreeSeconds

func (m *MockCommand) EveryThreeSeconds() Command

EveryThreeSeconds mocks base method.

func (*MockCommand) EveryTwoHours

func (m *MockCommand) EveryTwoHours() Command

EveryTwoHours mocks base method.

func (*MockCommand) EveryTwoMinutes

func (m *MockCommand) EveryTwoMinutes() Command

EveryTwoMinutes mocks base method.

func (*MockCommand) EveryTwoSeconds

func (m *MockCommand) EveryTwoSeconds() Command

EveryTwoSeconds mocks base method.

func (*MockCommand) Expression

func (m *MockCommand) Expression() string

Expression mocks base method.

func (*MockCommand) Fridays

func (m *MockCommand) Fridays() Command

Fridays mocks base method.

func (*MockCommand) Func

func (m *MockCommand) Func() func()

Func mocks base method.

func (*MockCommand) Hourly

func (m *MockCommand) Hourly() Command

Hourly mocks base method.

func (*MockCommand) HourlyAt

func (m *MockCommand) HourlyAt(arg0 []int) Command

HourlyAt mocks base method.

func (*MockCommand) LastDayOfMonth

func (m *MockCommand) LastDayOfMonth(arg0 string) Command

LastDayOfMonth mocks base method.

func (*MockCommand) Mondays

func (m *MockCommand) Mondays() Command

Mondays mocks base method.

func (*MockCommand) Monthly

func (m *MockCommand) Monthly() Command

Monthly mocks base method.

func (*MockCommand) MonthlyOn

func (m *MockCommand) MonthlyOn(arg0, arg1 string) Command

MonthlyOn mocks base method.

func (*MockCommand) Name

func (m *MockCommand) Name() string

Name mocks base method.

func (*MockCommand) Quarterly

func (m *MockCommand) Quarterly() Command

Quarterly mocks base method.

func (*MockCommand) QuarterlyOn

func (m *MockCommand) QuarterlyOn(arg0, arg1 string) Command

QuarterlyOn mocks base method.

func (*MockCommand) Saturdays

func (m *MockCommand) Saturdays() Command

Saturdays mocks base method.

func (*MockCommand) Sundays

func (m *MockCommand) Sundays() Command

Sundays mocks base method.

func (*MockCommand) Thursdays

func (m *MockCommand) Thursdays() Command

Thursdays mocks base method.

func (*MockCommand) Tuesdays

func (m *MockCommand) Tuesdays() Command

Tuesdays mocks base method.

func (*MockCommand) Wednesdays

func (m *MockCommand) Wednesdays() Command

Wednesdays mocks base method.

func (*MockCommand) Weekdays

func (m *MockCommand) Weekdays() Command

Weekdays mocks base method.

func (*MockCommand) Weekends

func (m *MockCommand) Weekends() Command

Weekends mocks base method.

func (*MockCommand) Weekly

func (m *MockCommand) Weekly() Command

Weekly mocks base method.

func (*MockCommand) WeeklyOn

func (m *MockCommand) WeeklyOn(arg0 int, arg1 string) Command

WeeklyOn mocks base method.

func (*MockCommand) Yearly

func (m *MockCommand) Yearly() Command

Yearly mocks base method.

func (*MockCommand) YearlyOn

func (m *MockCommand) YearlyOn(arg0, arg1, arg2 string) Command

YearlyOn mocks base method.

type MockCommandMockRecorder

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

MockCommandMockRecorder is the mock recorder for MockCommand.

func (*MockCommandMockRecorder) At

func (mr *MockCommandMockRecorder) At(arg0 any) *gomock.Call

At indicates an expected call of At.

func (*MockCommandMockRecorder) Cron

func (mr *MockCommandMockRecorder) Cron(arg0 any) *gomock.Call

Cron indicates an expected call of Cron.

func (*MockCommandMockRecorder) Daily

func (mr *MockCommandMockRecorder) Daily() *gomock.Call

Daily indicates an expected call of Daily.

func (*MockCommandMockRecorder) DailyAt

func (mr *MockCommandMockRecorder) DailyAt(arg0 any) *gomock.Call

DailyAt indicates an expected call of DailyAt.

func (*MockCommandMockRecorder) Days

func (mr *MockCommandMockRecorder) Days(arg0 any) *gomock.Call

Days indicates an expected call of Days.

func (*MockCommandMockRecorder) EveryFifteenMinutes

func (mr *MockCommandMockRecorder) EveryFifteenMinutes() *gomock.Call

EveryFifteenMinutes indicates an expected call of EveryFifteenMinutes.

func (*MockCommandMockRecorder) EveryFifteenSeconds

func (mr *MockCommandMockRecorder) EveryFifteenSeconds() *gomock.Call

EveryFifteenSeconds indicates an expected call of EveryFifteenSeconds.

func (*MockCommandMockRecorder) EveryFiveMinutes

func (mr *MockCommandMockRecorder) EveryFiveMinutes() *gomock.Call

EveryFiveMinutes indicates an expected call of EveryFiveMinutes.

func (*MockCommandMockRecorder) EveryFiveSeconds

func (mr *MockCommandMockRecorder) EveryFiveSeconds() *gomock.Call

EveryFiveSeconds indicates an expected call of EveryFiveSeconds.

func (*MockCommandMockRecorder) EveryFourHours

func (mr *MockCommandMockRecorder) EveryFourHours() *gomock.Call

EveryFourHours indicates an expected call of EveryFourHours.

func (*MockCommandMockRecorder) EveryFourMinutes

func (mr *MockCommandMockRecorder) EveryFourMinutes() *gomock.Call

EveryFourMinutes indicates an expected call of EveryFourMinutes.

func (*MockCommandMockRecorder) EveryFourSeconds

func (mr *MockCommandMockRecorder) EveryFourSeconds() *gomock.Call

EveryFourSeconds indicates an expected call of EveryFourSeconds.

func (*MockCommandMockRecorder) EveryMinute

func (mr *MockCommandMockRecorder) EveryMinute() *gomock.Call

EveryMinute indicates an expected call of EveryMinute.

func (*MockCommandMockRecorder) EverySecond

func (mr *MockCommandMockRecorder) EverySecond() *gomock.Call

EverySecond indicates an expected call of EverySecond.

func (*MockCommandMockRecorder) EverySixHours

func (mr *MockCommandMockRecorder) EverySixHours() *gomock.Call

EverySixHours indicates an expected call of EverySixHours.

func (*MockCommandMockRecorder) EveryTenMinutes

func (mr *MockCommandMockRecorder) EveryTenMinutes() *gomock.Call

EveryTenMinutes indicates an expected call of EveryTenMinutes.

func (*MockCommandMockRecorder) EveryTenSeconds

func (mr *MockCommandMockRecorder) EveryTenSeconds() *gomock.Call

EveryTenSeconds indicates an expected call of EveryTenSeconds.

func (*MockCommandMockRecorder) EveryThirtyMinutes

func (mr *MockCommandMockRecorder) EveryThirtyMinutes() *gomock.Call

EveryThirtyMinutes indicates an expected call of EveryThirtyMinutes.

func (*MockCommandMockRecorder) EveryThirtySeconds

func (mr *MockCommandMockRecorder) EveryThirtySeconds() *gomock.Call

EveryThirtySeconds indicates an expected call of EveryThirtySeconds.

func (*MockCommandMockRecorder) EveryThreeHours

func (mr *MockCommandMockRecorder) EveryThreeHours() *gomock.Call

EveryThreeHours indicates an expected call of EveryThreeHours.

func (*MockCommandMockRecorder) EveryThreeMinutes

func (mr *MockCommandMockRecorder) EveryThreeMinutes() *gomock.Call

EveryThreeMinutes indicates an expected call of EveryThreeMinutes.

func (*MockCommandMockRecorder) EveryThreeSeconds

func (mr *MockCommandMockRecorder) EveryThreeSeconds() *gomock.Call

EveryThreeSeconds indicates an expected call of EveryThreeSeconds.

func (*MockCommandMockRecorder) EveryTwoHours

func (mr *MockCommandMockRecorder) EveryTwoHours() *gomock.Call

EveryTwoHours indicates an expected call of EveryTwoHours.

func (*MockCommandMockRecorder) EveryTwoMinutes

func (mr *MockCommandMockRecorder) EveryTwoMinutes() *gomock.Call

EveryTwoMinutes indicates an expected call of EveryTwoMinutes.

func (*MockCommandMockRecorder) EveryTwoSeconds

func (mr *MockCommandMockRecorder) EveryTwoSeconds() *gomock.Call

EveryTwoSeconds indicates an expected call of EveryTwoSeconds.

func (*MockCommandMockRecorder) Expression

func (mr *MockCommandMockRecorder) Expression() *gomock.Call

Expression indicates an expected call of Expression.

func (*MockCommandMockRecorder) Fridays

func (mr *MockCommandMockRecorder) Fridays() *gomock.Call

Fridays indicates an expected call of Fridays.

func (*MockCommandMockRecorder) Func

func (mr *MockCommandMockRecorder) Func() *gomock.Call

Func indicates an expected call of Func.

func (*MockCommandMockRecorder) Hourly

func (mr *MockCommandMockRecorder) Hourly() *gomock.Call

Hourly indicates an expected call of Hourly.

func (*MockCommandMockRecorder) HourlyAt

func (mr *MockCommandMockRecorder) HourlyAt(arg0 any) *gomock.Call

HourlyAt indicates an expected call of HourlyAt.

func (*MockCommandMockRecorder) LastDayOfMonth

func (mr *MockCommandMockRecorder) LastDayOfMonth(arg0 any) *gomock.Call

LastDayOfMonth indicates an expected call of LastDayOfMonth.

func (*MockCommandMockRecorder) Mondays

func (mr *MockCommandMockRecorder) Mondays() *gomock.Call

Mondays indicates an expected call of Mondays.

func (*MockCommandMockRecorder) Monthly

func (mr *MockCommandMockRecorder) Monthly() *gomock.Call

Monthly indicates an expected call of Monthly.

func (*MockCommandMockRecorder) MonthlyOn

func (mr *MockCommandMockRecorder) MonthlyOn(arg0, arg1 any) *gomock.Call

MonthlyOn indicates an expected call of MonthlyOn.

func (*MockCommandMockRecorder) Name

func (mr *MockCommandMockRecorder) Name() *gomock.Call

Name indicates an expected call of Name.

func (*MockCommandMockRecorder) Quarterly

func (mr *MockCommandMockRecorder) Quarterly() *gomock.Call

Quarterly indicates an expected call of Quarterly.

func (*MockCommandMockRecorder) QuarterlyOn

func (mr *MockCommandMockRecorder) QuarterlyOn(arg0, arg1 any) *gomock.Call

QuarterlyOn indicates an expected call of QuarterlyOn.

func (*MockCommandMockRecorder) Saturdays

func (mr *MockCommandMockRecorder) Saturdays() *gomock.Call

Saturdays indicates an expected call of Saturdays.

func (*MockCommandMockRecorder) Sundays

func (mr *MockCommandMockRecorder) Sundays() *gomock.Call

Sundays indicates an expected call of Sundays.

func (*MockCommandMockRecorder) Thursdays

func (mr *MockCommandMockRecorder) Thursdays() *gomock.Call

Thursdays indicates an expected call of Thursdays.

func (*MockCommandMockRecorder) Tuesdays

func (mr *MockCommandMockRecorder) Tuesdays() *gomock.Call

Tuesdays indicates an expected call of Tuesdays.

func (*MockCommandMockRecorder) Wednesdays

func (mr *MockCommandMockRecorder) Wednesdays() *gomock.Call

Wednesdays indicates an expected call of Wednesdays.

func (*MockCommandMockRecorder) Weekdays

func (mr *MockCommandMockRecorder) Weekdays() *gomock.Call

Weekdays indicates an expected call of Weekdays.

func (*MockCommandMockRecorder) Weekends

func (mr *MockCommandMockRecorder) Weekends() *gomock.Call

Weekends indicates an expected call of Weekends.

func (*MockCommandMockRecorder) Weekly

func (mr *MockCommandMockRecorder) Weekly() *gomock.Call

Weekly indicates an expected call of Weekly.

func (*MockCommandMockRecorder) WeeklyOn

func (mr *MockCommandMockRecorder) WeeklyOn(arg0, arg1 any) *gomock.Call

WeeklyOn indicates an expected call of WeeklyOn.

func (*MockCommandMockRecorder) Yearly

func (mr *MockCommandMockRecorder) Yearly() *gomock.Call

Yearly indicates an expected call of Yearly.

func (*MockCommandMockRecorder) YearlyOn

func (mr *MockCommandMockRecorder) YearlyOn(arg0, arg1, arg2 any) *gomock.Call

YearlyOn indicates an expected call of YearlyOn.

type MockManager

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

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockManager) List

func (m *MockManager) List() []Command

List mocks base method.

func (*MockManager) NewCommand

func (m *MockManager) NewCommand(arg0 string, arg1 func() error) Command

NewCommand mocks base method.

func (*MockManager) Run

func (m *MockManager) Run(arg0 context.Context) error

Run mocks base method.

func (*MockManager) Shutdown

func (m *MockManager) Shutdown(arg0 context.Context) error

Shutdown mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) List

func (mr *MockManagerMockRecorder) List() *gomock.Call

List indicates an expected call of List.

func (*MockManagerMockRecorder) NewCommand

func (mr *MockManagerMockRecorder) NewCommand(arg0, arg1 any) *gomock.Call

NewCommand indicates an expected call of NewCommand.

func (*MockManagerMockRecorder) Run

func (mr *MockManagerMockRecorder) Run(arg0 any) *gomock.Call

Run indicates an expected call of Run.

func (*MockManagerMockRecorder) Shutdown

func (mr *MockManagerMockRecorder) Shutdown(arg0 any) *gomock.Call

Shutdown indicates an expected call of Shutdown.

type MockRunner

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

MockRunner is a mock of Runner interface.

func NewMockRunner

func NewMockRunner(ctrl *gomock.Controller) *MockRunner

NewMockRunner creates a new mock instance.

func (*MockRunner) AddCommand

func (m *MockRunner) AddCommand(arg0, arg1 string, arg2 func()) error

AddCommand mocks base method.

func (*MockRunner) EXPECT

func (m *MockRunner) EXPECT() *MockRunnerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRunner) Run

func (m *MockRunner) Run(arg0 context.Context) error

Run mocks base method.

func (*MockRunner) Shutdown

func (m *MockRunner) Shutdown(arg0 context.Context) error

Shutdown mocks base method.

type MockRunnerMockRecorder

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

MockRunnerMockRecorder is the mock recorder for MockRunner.

func (*MockRunnerMockRecorder) AddCommand

func (mr *MockRunnerMockRecorder) AddCommand(arg0, arg1, arg2 any) *gomock.Call

AddCommand indicates an expected call of AddCommand.

func (*MockRunnerMockRecorder) Run

func (mr *MockRunnerMockRecorder) Run(arg0 any) *gomock.Call

Run indicates an expected call of Run.

func (*MockRunnerMockRecorder) Shutdown

func (mr *MockRunnerMockRecorder) Shutdown(arg0 any) *gomock.Call

Shutdown indicates an expected call of Shutdown.

type Runner

type Runner interface {
	AddCommand(name string, expression string, fn func()) error
	Run(context.Context) error
	Shutdown(context.Context) error
}

func NewRobfigCronV3Runner

func NewRobfigCronV3Runner(logger mlog.Logger) Runner

NewRobfigCronV3Runner return contracts.Runner

Jump to

Keyboard shortcuts

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