diff options
author | Valery Piashchynski <[email protected]> | 2021-06-22 11:44:22 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-06-22 11:44:22 +0300 |
commit | 1a2a1f4735e40675abf6cd9767c99374359ec2bb (patch) | |
tree | 5abedf7306b50b02ba3892c0bc562307a62eb332 /plugins/jobs/oooold/job.go | |
parent | 260d69c21fba6d763d05dc5693689ddf7ce7bfe2 (diff) |
- Remove all old code, reformat, fix linters, return GA
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/oooold/job.go')
-rw-r--r-- | plugins/jobs/oooold/job.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/plugins/jobs/oooold/job.go b/plugins/jobs/oooold/job.go deleted file mode 100644 index 2f80c1cc..00000000 --- a/plugins/jobs/oooold/job.go +++ /dev/null @@ -1,38 +0,0 @@ -package oooold - -import json "github.com/json-iterator/go" - -// Handler handles job execution. -type Handler func(id string, j *Job) error - -// ErrorHandler handles job execution errors. -type ErrorHandler func(id string, j *Job, err error) - -// Job carries information about single job. -type Job struct { - // Job contains name of job broker (usually PHP class). - Job string `json:"job"` - - // Payload is string data (usually JSON) passed to Job broker. - Payload string `json:"payload"` - - // Options contains set of PipelineOptions specific to job execution. Can be empty. - Options *Options `json:"options,omitempty"` -} - -// Body packs job payload into binary payload. -func (j *Job) Body() []byte { - return []byte(j.Payload) -} - -// Context packs job context (job, id) into binary payload. -func (j *Job) Context(id string) []byte { - ctx, _ := json.Marshal( - struct { - ID string `json:"id"` - Job string `json:"job"` - }{ID: id, Job: j.Job}, - ) - - return ctx -} |