Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cron ¶
type Cron struct { Host string `json:"host"` User string `json:"user"` TimeZone string `json:"timezone"` Count int `json:"task_count"` Tasks []*Task `json:"tasks"` File string `json:"-"` // contains filtered or unexported fields }
Cron represents the info of crontab
var CronTab Cron
CronTab is a global singleton object
func (Cron) FindTaskByID ¶
FindTaskByID returns the task pointer with specified task id
func (*Cron) GetReportIDs ¶
GetReportIDs walks through cache dir and parse existing execution report, save it to reportIDs
func (*Cron) SetHost ¶
SetHost sets host info to c.Host. If param hostname exists, set c.Host to hostname
func (*Cron) SetTimeZone ¶
SetTimeZone sets timezone info to c.TimeZone. If param tz exists, set c.TimeZone to tz
type Task ¶
type Task struct { ID int `json:"id"` Title string `json:"title"` Schedule string `json:"schedule"` Command string `json:"command"` NextRun time.Time `json:"next_run"` Report *report.Report `json:"report,omitempty"` Checksum string `json:"checksum"` IsChanged bool `json:"is_changed_since_lastrun"` }
Task represents one task of crontab
Click to show internal directories.
Click to hide internal directories.