AFAIRE
sdk
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
2.4 KiB

/*
------------------------------------------------------------------------------------------------------------------------
####### sdk ####### Copyright (c) 2021 losyme ###################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package factory
import (
"time"
"forge.chapril.org/dune/jw"
)
type Job struct {
job *jw.Job
model Model
}
func (job *Job) SetID(value string) *Job {
job.job.SetID(value)
return job
}
func (job *Job) SetName(value string) *Job {
job.job.SetName(value)
return job
}
func (job *Job) SetOrigin(value string) *Job {
job.job.SetOrigin(value)
return job
}
func (job *Job) SetPriority(value jw.Priority) *Job {
job.job.SetPriority(value)
return job
}
func (job *Job) SetPriorityNone() *Job {
job.job.SetPriorityNone()
return job
}
func (job *Job) SetPriorityLow() *Job {
job.job.SetPriorityLow()
return job
}
func (job *Job) SetPriorityMedium() *Job {
job.job.SetPriorityMedium()
return job
}
func (job *Job) SetPriorityHigh() *Job {
job.job.SetPriorityHigh()
return job
}
func (job *Job) SetPriorityCritical() *Job {
job.job.SetPriorityCritical()
return job
}
func (job *Job) SetPublic(key string, value interface{}) *Job {
job.job.SetPublic(key, value)
return job
}
func (job *Job) SetPrivate(key string, value interface{}) *Job {
job.job.SetPrivate(key, value)
return job
}
func (job *Job) SetRunAfter(value time.Time) *Job {
job.job.SetRunAfter(value)
return job
}
func (job *Job) SetExclusivity(value jw.Exclusivity) *Job {
job.job.SetExclusivity(value)
return job
}
func (job *Job) SetExclusivityNo() *Job {
job.job.SetExclusivityNo()
return job
}
func (job *Job) SetExclusivityItself() *Job {
job.job.SetExclusivityItself()
return job
}
func (job *Job) SetExclusivityNamespace() *Job {
job.job.SetExclusivityNamespace()
return job
}
func (job *Job) SetMaxRetries(value int) *Job {
job.job.SetMaxRetries(value)
return job
}
func (job *Job) SetMaxOccurences(value int) *Job {
job.job.SetMaxOccurences(value)
return job
}
func (job *Job) SetCategory(value string) *Job {
job.job.SetCategory(value)
return job
}
func (job *Job) CreateJob() (*jw.Job, error) {
return job.model.CreateJob(job.job)
}
/*
######################################################################################################## @(°_°)@ #######
*/