Documentation
¶
Index ¶
- Variables
- func Add(tp TypeJob, tag, spec string, params et.Json, repetitions int, ...) error
- func AddCronjob(tag, spec string, params et.Json, repetitions int, fn func(event.Message)) error
- func AddOneShot(tag, spec string, params et.Json, repetitions int, fn func(event.Message)) error
- func Close()
- func Load(tag string) error
- func Remove(tag string) error
- func Start(tag string) (int, error)
- func StartCrontab() error
- func Stop(tag string) error
- func StopCrontab() error
- type Job
- type JobStatus
- type Jobs
- type TypeJob
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EVENT_CRONTAB_SET = "event:crontab:set" EVENT_CRONTAB_REMOVE = "event:crontab:remove" EVENT_CRONTAB_STOP = "event:crontab:stop" EVENT_CRONTAB_START = "event:crontab:start" EVENT_CRONTAB_STATUS = "event:crontab:status" )
View Source
var (
ErrJobExists = fmt.Errorf("job already exists")
)
View Source
var (
MSG_CRONTAB_UNLOAD = "crontab unloaded"
)
Functions ¶
func Add ¶ added in v1.0.11
func Add(tp TypeJob, tag, spec string, params et.Json, repetitions int, fn func(event.Message)) error
* * Add * Add job to crontab in execute local * @param tp TypeJob, tag, spec string, params et.Json, repetitions int, fn func(event.Message) * @return error *
func AddCronjob ¶ added in v1.0.11
* * AddCronjob * @param tag, spec string, params et.Json, repetitions int, fn func(event.Message) * @return error *
func AddOneShot ¶ added in v1.0.11
* * AddOneShot * @param tag, spec string, params et.Json, repetitions int, fn func(event.Message) * @return error *
Types ¶
type Job ¶
type Job struct {
Type TypeJob `json:"type"`
Tag string `json:"tag"`
Channel string `json:"channel"`
Params et.Json `json:"params"`
Spec string `json:"spec"`
Started bool `json:"started"`
Status JobStatus `json:"status"`
Idx int `json:"idx"`
HostName string `json:"host_name"`
Attempts int `json:"attempts"`
Repetitions int `json:"repetitions"`
ShotTime time.Time `json:"shot_time"`
Duration time.Duration `json:"duration"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.