Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists error = errors.New(`item already exists in the queue`)
View Source
var ErrItemNoID error = errors.New(`item must have ID`)
View Source
var ErrNotEnoughWorkers = errors.New("queue requires >= 1 workers")
View Source
var ErrNotFound error = errors.New(`item not found in the queue`)
View Source
var ErrQueueFull = errors.New("queue is full")
Functions ¶
This section is empty.
Types ¶
type ItemMetadata ¶
type Queue ¶
type Queue interface { Enqueue(func(context.Context)) error // Adds item to the queue Start() // Starts the processing of the queue Stop() // Stops the processing of the queue }
Queue encapsulates the Enqueue method that will be called by a dispatcher
type QueueRepository ¶
type QueueRepository interface { List(context.Context) ([]*Item, error) Get(context.Context, string) (*Item, error) Create(context.Context, Item) error }
QueueRepository is a store of Queue items
func NewQueueRepository ¶
func NewQueueRepository(queue Queue) QueueRepository
NewQueueRepository creates a repository that returns queue information
Click to show internal directories.
Click to hide internal directories.