-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcronx_status.go
More file actions
28 lines (23 loc) · 736 Bytes
/
cronx_status.go
File metadata and controls
28 lines (23 loc) · 736 Bytes
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
package cronx
import (
"time"
"github.com/rizalgowandy/gdk/pkg/pagination"
"github.com/robfig/cron/v3"
)
//go:generate gomodifytags -all --quiet -w -file cronx_status.go -clear-tags
//go:generate gomodifytags -all --quiet --skip-unexported -w -file cronx_status.go -add-tags json
// StatusData defines current job status.
type StatusData struct {
// ID is unique per job.
ID cron.EntryID `json:"id"`
// Job defines current job.
Job *Job `json:"job"`
// Next defines the next schedule to execute current job.
Next time.Time `json:"next"`
// Prev defines the last run of the current job.
Prev time.Time `json:"prev"`
}
type StatusPageData struct {
Data []StatusData `json:"data"`
Sort pagination.Sort `json:"sort"`
}