-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
64 lines (55 loc) · 820 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package cron
import (
"time"
)
type Cron struct {
expression string
}
const (
MINUTE = 0
HOUR = 1
DAY = 2
MONTH = 3
WEEKDAY = 4
YEAR = 5
)
/**
* Named constructor for the cron parser.
*/
func Create(expression string) *Cron {
switch expression {
case "@daily":
expression = "0 0 * * *"
}
return &Cron{expression}
}
/**
* Return the compiled expression
*/
func (cron *Cron) Compile() string {
return cron.expression
}
/**
* Validate the given cron expression
*/
func (cron *Cron) Validate() bool {
//
}
/**
* Get the next running dates
*/
func (cron *Cron) Next(count int) time.Time {
//
}
/**
* Get the previous running dates
*/
func (cron *Cron) Previous(count int) time.Time {
//
}
/**
* Check if the cron is currently due.
*/
func (cron *Cron) IsDue() bool {
//
}