Documentation ¶
Index ¶
- type BackgroundWorker
- type Context
- func (c *Context) BaseURL() string
- func (c *Context) Failure(err error) error
- func (c *Context) Logger() log.Logger
- func (c *Context) Services() *app.Services
- func (c *Context) SetBaseURL(baseURL string)
- func (c *Context) SetServices(services *app.Services)
- func (c *Context) SetTenant(tenant *models.Tenant)
- func (c *Context) SetUser(user *models.User)
- func (c *Context) TaskName() string
- func (c *Context) Tenant() *models.Tenant
- func (c *Context) User() *models.User
- func (c *Context) WorkerID() string
- type Job
- type MiddlewareFunc
- type Task
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundWorker ¶
type BackgroundWorker struct {
// contains filtered or unexported fields
}
BackgroundWorker is a worker that runs tasks on background
func (*BackgroundWorker) Enqueue ¶
func (w *BackgroundWorker) Enqueue(task Task)
Enqueue a task on current worker
func (*BackgroundWorker) Length ¶
func (w *BackgroundWorker) Length() int
Length from current queue length
func (*BackgroundWorker) Logger ¶
func (w *BackgroundWorker) Logger() log.Logger
Logger from current worker
func (*BackgroundWorker) Run ¶
func (w *BackgroundWorker) Run(id string)
Run initializes the worker loop
func (*BackgroundWorker) Use ¶
func (w *BackgroundWorker) Use(middleware MiddlewareFunc)
Use this to inject worker dependencies
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context holds references to services available for jobs
func NewContext ¶
NewContext creates a new context
func (*Context) SetServices ¶
SetServices on current context
Click to show internal directories.
Click to hide internal directories.