Documentation
¶
Index ¶
- Variables
- func AddEventJob(tag, spec, channel string, repetitions int, started bool, params et.Json, ...) error
- func AddOneShotEventJob(tag, spec, channel string, started bool, params et.Json, ...) error
- func Close()
- func DeleteJob(tag string) error
- func Load(tag string) error
- func SetDeleteInstanceFn(fn DeleteInstanceFn)
- func SetGetInstanceFn(fn GetInstanceFn)
- func SetQueryInstanceFn(fn QueryInstanceFn)
- func SetSetInstanceFn(fn SetInstanceFn)
- func StartJob(tag string) (int, error)
- func Stop() error
- func StopJob(tag string) error
- type DeleteInstanceFn
- type GetInstanceFn
- type Job
- type JobStatus
- type Jobs
- type QueryInstanceFn
- type SetInstanceFn
- type TypeJob
Constants ¶
This section is empty.
Variables ¶
var ( EVENT_CRONTAB_SET = "event:crontab:set" EVENT_CRONTAB_DELETE = "event:crontab:delete" EVENT_CRONTAB_STOP = "event:crontab:stop" EVENT_CRONTAB_START = "event:crontab:start" )
var (
ErrJobExists = fmt.Errorf("job already exists")
)
var (
MSG_CRONTAB_UNLOAD = "crontab unloaded"
)
Functions ¶
func AddEventJob ¶ added in v1.1.182
func AddEventJob(tag, spec, channel string, repetitions int, started bool, params et.Json, fn func(event.EvenMessage)) error
* * AddEventJob * Event job to crontab function execute was notified by event workers * @param tag, spec, channel string, repetitions int, started bool, params et.Json, fn func(event.EvenMessage) * @return *Job, error *
func AddOneShotEventJob ¶ added in v1.1.182
func AddOneShotEventJob(tag, spec, channel string, started bool, params et.Json, fn func(event.EvenMessage)) error
* * AddOneShotEventJob * Event job to crontab function execute was notified by event workers * @param tag, spec, channel string, repetitions int, started bool, params et.Json, fn func(event.EvenMessage) * @return *Job, error *
func SetDeleteInstanceFn ¶ added in v1.1.182
func SetDeleteInstanceFn(fn DeleteInstanceFn)
* * SetDeleteInstanceFn * @param fn DeleteInstanceFn *
func SetGetInstanceFn ¶ added in v1.1.182
func SetGetInstanceFn(fn GetInstanceFn)
* * SetGetInstanceFn * @param fn GetInstanceFn *
func SetQueryInstanceFn ¶ added in v1.1.182
func SetQueryInstanceFn(fn QueryInstanceFn)
* * SetQueryInstanceFn * @param fn QueryInstanceFn *
func SetSetInstanceFn ¶ added in v1.1.182
func SetSetInstanceFn(fn SetInstanceFn)
* * SetSetInstanceFn * @param fn SetInstanceFn *
Types ¶
type DeleteInstanceFn ¶ added in v1.1.182
type GetInstanceFn ¶ added in v1.1.182
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"`
Duration time.Duration `json:"duration"`
ShotTime time.Time `json:"shot_time"`
// contains filtered or unexported fields
}
func AddJob ¶
func AddJob(tag, spec string, params et.Json, repetitions int, started bool, fn func(job *Job)) (*Job, error)
* * AddJob * Add job to crontab in execute local * @param tag, spec string, params et.Json, repetitions int, started bool, fn func(job *Job) * @return *Job, error *
func AddOneShotJob ¶ added in v1.1.182
func AddOneShotJob(tag, spec string, params et.Json, repetitions int, started bool, fn func(job *Job)) (*Job, error)
* * AddOneShotJob * Add job to crontab in execute local * @param tag, spec string, params et.Json, repetitions int, started bool, fn func(job *Job) * @return *Job, error *