Versions in this module Expand all Collapse all v0 v0.0.2 Mar 10, 2020 v0.0.1 Mar 8, 2020 Changes in this version + const JobStatusCancelled + const JobStatusDone + const JobStatusException + const JobStatusKilled + const JobStatusNew + const JobStatusRunning + const JobStatusScheduled + type Config struct + Admin *admin.Admin + Job QorJobInterface + Queue Queue + type Cron struct + CronJobs []string + Jobs []*cronJob + func NewCronQueue() *Cron + func (cron *Cron) Add(job QorJobInterface) (err error) + func (cron *Cron) Kill(job QorJobInterface) (err error) + func (cron *Cron) Remove(job QorJobInterface) error + func (cron *Cron) Run(qorJob QorJobInterface) error + type Job struct + Group string + Handler func(interface{}, QorJobInterface) error + Name string + Permission *roles.Permission + Queue Queue + Resource *admin.Resource + Worker *Worker + func (job *Job) GetQueue() Queue + func (job *Job) NewStruct() interface{} + func (job Job) HasPermission(mode roles.PermissionMode, context *qor.Context) bool + type QorJob struct + Job *Job + Log string + Progress uint + ProgressText string + ResultsTable ResultsTable + Status string + func (job *QorJob) AddLog(log string) error + func (job *QorJob) AddResultsRow(cells ...TableCell) error + func (job *QorJob) GetArgument() interface{} + func (job *QorJob) GetJob() *Job + func (job *QorJob) GetJobID() string + func (job *QorJob) GetJobName() string + func (job *QorJob) GetLogs() []string + func (job *QorJob) GetProgress() uint + func (job *QorJob) GetProgressText() string + func (job *QorJob) GetResultsTable() ResultsTable + func (job *QorJob) GetSerializableArgumentResource() *admin.Resource + func (job *QorJob) GetStatus() string + func (job *QorJob) SetJob(j *Job) + func (job *QorJob) SetProgress(progress uint) error + func (job *QorJob) SetProgressText(str string) error + func (job *QorJob) SetStatus(status string) error + func (job *QorJob) StartReferesh() + func (job *QorJob) StopReferesh() + type QorJobInterface interface + AddLog func(string) error + AddResultsRow func(...TableCell) error + GetArgument func() interface{} + GetJob func() *Job + GetJobID func() string + GetJobName func() string + GetLogs func() []string + GetProgress func() uint + GetProgressText func() string + GetResultsTable func() ResultsTable + GetStatus func() string + SetJob func(*Job) + SetProgress func(uint) error + SetProgressText func(string) error + SetStatus func(string) error + StartReferesh func() + StopReferesh func() + type Queue interface + Add func(QorJobInterface) error + Kill func(QorJobInterface) error + Remove func(QorJobInterface) error + Run func(QorJobInterface) error + type ResultsTable struct + Name string + TableCells [][]TableCell + func (resultsTable *ResultsTable) Scan(data interface{}) error + func (resultsTable ResultsTable) Value() (driver.Value, error) + type Schedule struct + ScheduleTime *time.Time + func (schedule Schedule) GetScheduleTime() *time.Time + type Scheduler interface + GetScheduleTime func() *time.Time + type TableCell struct + Error string + Value string + type Worker struct + JobResource *admin.Resource + Jobs []*Job + func New(config ...*Config) *Worker + func (worker *Worker) AddJob(qorJob QorJobInterface) error + func (worker *Worker) ConfigureQorResource(res resource.Resourcer) + func (worker *Worker) ConfigureQorResourceBeforeInitialize(res resource.Resourcer) + func (worker *Worker) GetJob(jobID string) (QorJobInterface, error) + func (worker *Worker) GetRegisteredJob(name string) *Job + func (worker *Worker) KillJob(jobID string) error + func (worker *Worker) RegisterJob(job *Job) error + func (worker *Worker) RemoveJob(jobID string) error + func (worker *Worker) RunJob(jobID string) error + func (worker *Worker) SetQueue(queue Queue)