Skip to content

Commit 1742845

Browse files
committed
chore: change module name
1 parent bc59245 commit 1742845

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ _cgo_export.*
2020
_testmain.go
2121

2222
*.exe
23+
.gitignore
24+
.vscode
25+
.idea
26+
tmp

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Cron V3 has been released!
77

88
To download the specific tagged release, run:
99
```bash
10-
go get github.com/robfig/cron/[email protected].0
10+
go get github.com/fufuok/cron@v0.3.0
1111
```
1212
Import it in your program as:
1313
```go
14-
import "github.com/robfig/cron/v3"
14+
import "github.com/fufuok/cron"
1515
```
1616
It requires Go 1.11 or later due to usage of Go Modules.
1717

@@ -33,7 +33,7 @@ the timezone support, and fixes a number of bugs.
3333
New features:
3434

3535
- Support for Go modules. Callers must now import this library as
36-
`github.com/robfig/cron/v3`, instead of `gopkg.in/...`
36+
`github.com/fufuok/cron`, instead of `gopkg.in/...`
3737

3838
- Fixed bugs:
3939
- 0f01e6b parser: fix combining of Dow and Dom (#70)

doc.go

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*
22
Package cron implements a cron spec parser and job runner.
33
4-
Installation
4+
# Installation
55
66
To download the specific tagged release, run:
77
8-
go get github.com/robfig/cron/[email protected].0
8+
go get github.com/fufuok/cron@v0.3.0
99
1010
Import it in your program as:
1111
12-
import "github.com/robfig/cron/v3"
12+
import "github.com/fufuok/cron"
1313
1414
It requires Go 1.11 or later due to usage of Go Modules.
1515
16-
Usage
16+
# Usage
1717
1818
Callers may register Funcs to be invoked on a given schedule. Cron will run
1919
them in their own goroutines.
@@ -36,7 +36,7 @@ them in their own goroutines.
3636
..
3737
c.Stop() // Stop the scheduler (does not stop any jobs already running).
3838
39-
CRON Expression Format
39+
# CRON Expression Format
4040
4141
A cron expression represents a set of times, using 5 space-separated fields.
4242
@@ -54,7 +54,7 @@ Month and Day-of-week field values are case insensitive. "SUN", "Sun", and
5454
The specific interpretation of the format is based on the Cron Wikipedia page:
5555
https://en.wikipedia.org/wiki/Cron
5656
57-
Alternative Formats
57+
# Alternative Formats
5858
5959
Alternative Cron expression formats support other fields like seconds. You can
6060
implement that by creating a custom Parser as follows.
@@ -73,7 +73,7 @@ parser you saw earlier, except that its seconds field is REQUIRED:
7373
That emulates Quartz, the most popular alternative Cron schedule format:
7474
http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html
7575
76-
Special Characters
76+
# Special Characters
7777
7878
Asterisk ( * )
7979
@@ -105,7 +105,7 @@ Question mark ( ? )
105105
Question mark may be used instead of '*' for leaving either day-of-month or
106106
day-of-week blank.
107107
108-
Predefined schedules
108+
# Predefined schedules
109109
110110
You may use one of several pre-defined schedules in place of a cron expression.
111111
@@ -117,12 +117,12 @@ You may use one of several pre-defined schedules in place of a cron expression.
117117
@daily (or @midnight) | Run once a day, midnight | 0 0 * * *
118118
@hourly | Run once an hour, beginning of hour | 0 * * * *
119119
120-
Intervals
120+
# Intervals
121121
122122
You may also schedule a job to execute at fixed intervals, starting at the time it's added
123123
or cron is run. This is supported by formatting the cron spec like this:
124124
125-
@every <duration>
125+
@every <duration>
126126
127127
where "duration" is a string accepted by time.ParseDuration
128128
(http://golang.org/pkg/time/#ParseDuration).
@@ -134,13 +134,13 @@ Note: The interval does not take the job runtime into account. For example,
134134
if a job takes 3 minutes to run, and it is scheduled to run every 5 minutes,
135135
it will have only 2 minutes of idle time between each run.
136136
137-
Time zones
137+
# Time zones
138138
139139
By default, all interpretation and scheduling is done in the machine's local
140140
time zone (time.Local). You can specify a different time zone on construction:
141141
142-
cron.New(
143-
cron.WithLocation(time.UTC))
142+
cron.New(
143+
cron.WithLocation(time.UTC))
144144
145145
Individual cron schedules may also override the time zone they are to be
146146
interpreted in by providing an additional space-separated field at the beginning
@@ -169,7 +169,7 @@ The prefix "TZ=(TIME ZONE)" is also supported for legacy compatibility.
169169
Be aware that jobs scheduled during daylight-savings leap-ahead transitions will
170170
not be run!
171171
172-
Job Wrappers
172+
# Job Wrappers
173173
174174
A Cron runner may be configured with a chain of job wrappers to add
175175
cross-cutting functionality to all submitted jobs. For example, they may be used
@@ -192,15 +192,15 @@ Install wrappers for individual jobs by explicitly wrapping them:
192192
cron.SkipIfStillRunning(logger),
193193
).Then(job)
194194
195-
Thread safety
195+
# Thread safety
196196
197197
Since the Cron service runs concurrently with the calling code, some amount of
198198
care must be taken to ensure proper synchronization.
199199
200200
All cron methods are designed to be correctly synchronized as long as the caller
201201
ensures that invocations have a clear happens-before ordering between them.
202202
203-
Logging
203+
# Logging
204204
205205
Cron defines a Logger interface that is a subset of the one defined in
206206
github.com/go-logr/logr. It has two logging levels (Info and Error), and
@@ -216,16 +216,15 @@ Activate it with a one-off logger as follows:
216216
cron.WithLogger(
217217
cron.VerbosePrintfLogger(log.New(os.Stdout, "cron: ", log.LstdFlags))))
218218
219-
220-
Implementation
219+
# Implementation
221220
222221
Cron entries are stored in an array, sorted by their next activation time. Cron
223222
sleeps until the next job is due to be run.
224223
225224
Upon waking:
226-
- it runs each entry that is active on that second
227-
- it calculates the next run times for the jobs that were run
228-
- it re-sorts the array of entries by next activation time.
229-
- it goes to sleep until the soonest job.
225+
- it runs each entry that is active on that second
226+
- it calculates the next run times for the jobs that were run
227+
- it re-sorts the array of entries by next activation time.
228+
- it goes to sleep until the soonest job.
230229
*/
231230
package cron

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/robfig/cron/v3
1+
module github.com/fufuok/cron
22

3-
go 1.12
3+
go 1.15

0 commit comments

Comments
 (0)