Versions in this module Expand all Collapse all v1 v1.0.0 Jul 21, 2026 Changes in this version + const ContextJobKey + const ContextQueueKey + const MaxTime + var JobError = joberror + var JobStatus = jobstatus + var StoreError = storeerror + type Foreman interface + AddJob func(job *Job) error + AddJobTransaction func(ctx context.Context, job *Job) error + AddJobWithSchedule func(ctx context.Context, job *Job, runat int64) error + AddMiddleware func(midl ...MiddlewareFunc) + AddWorker func(title string, worker HandlerFunc, midl ...MiddlewareFunc) error + GetCounter func() int + Serve func() error + Strike func(ttl int) error + func NewForeman(config *QueueConfig, store JobStorage, logger Logger) Foreman + type Governor interface + AddJob func(string) + DelJob func(string) + GetCounter func() int + NoJob func() + Spawn func() (bool, []string) + func NewLocalOndemandGovernor(max, min, maxworker int, jd map[string]JobDescription) Governor + type HandlerFunc func(ctx context.Context) error + type Job struct + ID string + JobID string + Message string + Payload string + Priority int + Result string + Status string + Title string + Try int + UpdatedAt int64 + type JobDescription struct + Concurrent int + MaxRetry int + Priority int + Secure bool + TTL int + Title string + type JobStorage interface + CheckDuplicateJob func(job Job) error + CreateJob func(ctx context.Context, job Job) error + CreateScheduleJob func(ctx context.Context, job ScheduleJob) error + GetAndLockAvailableJob func(jd map[string]JobDescription, ignorelist ...string) (*Job, error) + GetScheduledJob func(from, to int64) ([]*ScheduleJob, error) + InjectJob func(Job) error + UpdateJobResult func(job Job) error + UpdateScheduledJob func(ScheduleJob) error + type LocalOndemandGovernor struct + CurSleep *int + JobCounter map[string]*int + JobDescription map[string]JobDescription + Locker *sync.Mutex + MaxSleep int + MaxWorker int + MinSleep int + WorkerCounter *int + func (g LocalOndemandGovernor) AddJob(title string) + func (g LocalOndemandGovernor) DelJob(title string) + func (g LocalOndemandGovernor) GetCounter() int + func (g LocalOndemandGovernor) NoJob() + func (g LocalOndemandGovernor) Spawn() (bool, []string) + type Logger interface + Debug func(msg string) + Error func(msg string) + Fatal func(msg string) + Info func(msg string) + Panic func(msg string) + Warn func(msg string) + type MiddlewareFunc func(HandlerFunc) HandlerFunc + type QueueConfig struct + BreakTime int + CleanError bool + Concurrent int + JobDescription map[string]JobDescription + RampTime int + type ScheduleJob struct + ExecuteID string + ID string + JobID string + Log string + Payload string + Priority int + Schedule int64 + Status string + Title string + UpdatedAt int64