cmd

package
v0.0.0-...-c4b4742 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Example (ExecuteDailySchedule)
checkList := [][]string{
	{"Daily_schedule", "every_day"},
	{"Daily_schedule", "every_day", "at", "01:01"},
	{"Daily_schedule"},
	{"Daily_schedule", "test"},
}
for i := range checkList {
	executeDailySchedule(checkList[i])
}
Output:

0 0 */1 * *
1 1 */1 * *
Invalid daily schedule
Invalid daily schedule
Example (ExecuteMonthlySchedule)
checkList := [][]string{
	{"Monthly_schedule", "on", "1st_day", "of_every_month"},
	{"Monthly_schedule", "on", "1st_day", "of_every", "2_month"},
	{"Monthly_schedule", "on", "1st_day", "of_every_month", "at", "01:01"},
	{"Monthly_schedule", "on", "1st_day", "of_every", "2_month", "at", "01:01"},
	{"Monthly_schedule", "test"},
	{"Monthly_schedule", "on", "test", "of_every_month"},
	{"Monthly_schedule", "on", "1st_day", "of_every", "test"},
	{"Monthly_schedule", "on", "1st_day", "of_every_month", "at", "test"},
	{"Monthly_schedule", "on", "1st_day", "of_every", "2_month", "at", "test"},
}
for i := range checkList {
	executeMonthlySchedule(checkList[i])
}
Output:

0 0 1 */1 *
0 0 1 */2 *
1 1 1 */1 *
1 1 1 */2 *
Invalid monthly schedule
Invalid monthly schedule
Invalid monthly schedule
Invalid monthly schedule
Invalid monthly schedule
Example (ExecuteTimeSchedule)
checkList := [][]string{
	{"Time_schedule", "every_minute", "1_minute"},
	{"Time_schedule", "every_hour", "1_hour"},
	{"Time_schedule", "test"},
	{"Time_schedule", "every_hour", "test"},
}
for i := range checkList {
	executeTimeSchedule(checkList[i])
}
Output:

*/1 * * * *
* */1 * * *
Invalid time schedule
Invalid time schedule
Example (ExecuteWeeklySchedule)
checkList := [][]string{
	{"Weekly_schedule", "on_every", "Sunday"},
	{"Weekly_schedule", "on_every", "Sunday", "at", "01:01"},
	{"Weekly_schedule", "test"},
	{"Weekly_schedule", "on_every", "test"},
	{"Weekly_schedule", "on_every", "Sunday", "at", "test"},
}
for i := range checkList {
	executeWeeklySchedule(checkList[i])
}
Output:

0 0 * * 0
1 1 * * 0
Invalid weekly schedule
Invalid weekly schedule
Invalid weekly schedule
Example (ExecuteYearlySchedule)
checkList := [][]string{
	{"Yearly_schedule", "in_every", "January", "1st"},
	{"Yearly_schedule", "in_every", "January", "1st", "at", "01:01"},
	{"Yearly_schedule", "in_every", "January", "test"},
	{"Yearly_schedule", "in_every", "January", "1st", "at", "test"},
	{"Yearly_schedule", "test"},
}
for i := range checkList {
	executeYearlySchedule(checkList[i])
}
Output:

0 0 1 1 *
1 1 1 1 *
Invalid yearly schedule
Invalid yearly schedule
Invalid yearly schedule
Example (GetNextTime)
var cmd *cobra.Command
getNextTime(cmd, []string{"*", "*", "*", "*"})
Output:

Invalid syntax
Example (Translate)
var cmd *cobra.Command
checkList := [][]string{
	{"*", "*", "*", "*", "*"},
	{"*", "*", "*", "*"},
}
for i := range checkList {
	translate(cmd, checkList[i])
}
Output:

At every minute
Invalid syntax

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute for cobra

Types

This section is empty.

Jump to

Keyboard shortcuts

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