summaryrefslogtreecommitdiff
path: root/plugins/jobs/job/job.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-09-16 21:46:50 +0300
committerGitHub <[email protected]>2021-09-16 21:46:50 +0300
commit3581b45f237a3f7aa29591ceb2bf6f4a4642a2f5 (patch)
treee723b19ec1ac16b7ccc7b3c2da69d4a416d63d81 /plugins/jobs/job/job.go
parent337d292dd2d6ff0a555098b1970d8194d8df8bc2 (diff)
parent823d831b57b75f70c7c3bbbee355f2016633bb3b (diff)
[#803]: feat(plugins): move plugins to a separate repositoryv2.5.0-alpha.2
[#803]: feat(plugins): move plugins to a separate repository
Diffstat (limited to 'plugins/jobs/job/job.go')
-rw-r--r--plugins/jobs/job/job.go51
1 files changed, 0 insertions, 51 deletions
diff --git a/plugins/jobs/job/job.go b/plugins/jobs/job/job.go
deleted file mode 100644
index adab2a0a..00000000
--- a/plugins/jobs/job/job.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package job
-
-import (
- "time"
-)
-
-// constant keys to pack/unpack messages from different drivers
-const (
- RRID string = "rr_id"
- RRJob string = "rr_job"
- RRHeaders string = "rr_headers"
- RRPipeline string = "rr_pipeline"
- RRDelay string = "rr_delay"
- RRPriority string = "rr_priority"
-)
-
-// Job carries information about single job.
-type Job struct {
- // Job contains name of job broker (usually PHP class).
- Job string `json:"job"`
-
- // Ident is unique identifier of the job, should be provided from outside
- Ident string `json:"id"`
-
- // Payload is string data (usually JSON) passed to Job broker.
- Payload string `json:"payload"`
-
- // Headers with key-value pairs
- Headers map[string][]string `json:"headers"`
-
- // Options contains set of PipelineOptions specific to job execution. Can be empty.
- Options *Options `json:"options,omitempty"`
-}
-
-// Options carry information about how to handle given job.
-type Options struct {
- // Priority is job priority, default - 10
- // pointer to distinguish 0 as a priority and nil as priority not set
- Priority int64 `json:"priority"`
-
- // Pipeline manually specified pipeline.
- Pipeline string `json:"pipeline,omitempty"`
-
- // Delay defines time duration to delay execution for. Defaults to none.
- Delay int64 `json:"delay,omitempty"`
-}
-
-// DelayDuration returns delay duration in a form of time.Duration.
-func (o *Options) DelayDuration() time.Duration {
- return time.Second * time.Duration(o.Delay)
-}