summaryrefslogtreecommitdiff
path: root/plugins/jobs/structs/job.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-07-05 18:44:29 +0300
committerValery Piashchynski <[email protected]>2021-07-05 18:44:29 +0300
commit207739f7346c98e16087547bc510e1f909671260 (patch)
tree5c6eac27beb4eb5e127c7d8dae3464edb3359be9 /plugins/jobs/structs/job.go
parent300166eda7b138847008a7653f90753bd8397b9e (diff)
- Update PQ
- Update ephemeral plugin, complete Push - Add Jobs full configuration Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/structs/job.go')
-rw-r--r--plugins/jobs/structs/job.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/jobs/structs/job.go b/plugins/jobs/structs/job.go
index 2e394543..268444db 100644
--- a/plugins/jobs/structs/job.go
+++ b/plugins/jobs/structs/job.go
@@ -17,19 +17,35 @@ type Job struct {
Options *Options `json:"options,omitempty"`
}
+func (j *Job) ID() string {
+ return j.Options.ID
+}
+
+func (j *Job) Priority() uint64 {
+ return *j.Options.Priority
+}
+
// Body packs job payload into binary payload.
func (j *Job) Body() []byte {
return utils.AsBytes(j.Payload)
}
// Context packs job context (job, id) into binary payload.
-func (j *Job) Context(id string) []byte {
+func (j *Job) Context() []byte {
ctx, _ := json.Marshal(
struct {
ID string `json:"id"`
Job string `json:"job"`
- }{ID: id, Job: j.Job},
+ }{ID: j.Options.ID, Job: j.Job},
)
return ctx
}
+
+func (j *Job) Ack() {
+
+}
+
+func (j *Job) Nack() {
+
+}