Documentation ¶
Index ¶
- type Job
- type Store
- func (s *Store) Create(ctx context.Context, job *jobqueue.Job) error
- func (s *Store) Delete(ctx context.Context, job *jobqueue.Job) error
- func (s *Store) List(ctx context.Context, request *jobqueue.ListRequest) (*jobqueue.ListResponse, error)
- func (s *Store) Lookup(ctx context.Context, id string) (*jobqueue.Job, error)
- func (s *Store) LookupByCorrelationID(ctx context.Context, correlationID string) ([]*jobqueue.Job, error)
- func (s *Store) Next() (*jobqueue.Job, error)
- func (s *Store) Start(b jobqueue.StartupBehaviour) error
- func (s *Store) Stats(ctx context.Context, req *jobqueue.StatsRequest) (*jobqueue.Stats, error)
- func (s *Store) Update(ctx context.Context, job *jobqueue.Job) error
- type StoreOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents a persistent MySQL storage implementation. It implements the jobqueue.Store interface.
func NewStore ¶
func NewStore(url string, options ...StoreOption) (*Store, error)
NewStore initializes a new MySQL-based storage.
func (*Store) List ¶
func (s *Store) List(ctx context.Context, request *jobqueue.ListRequest) (*jobqueue.ListResponse, error)
List returns a list of all jobs stored in the data store.
func (*Store) LookupByCorrelationID ¶
func (s *Store) LookupByCorrelationID(ctx context.Context, correlationID string) ([]*jobqueue.Job, error)
LookupByCorrelationID returns the details of jobs by their correlation identifier. If no such job could be found, an empty array is returned.
func (*Store) Start ¶
func (s *Store) Start(b jobqueue.StartupBehaviour) error
Start is called when the manager starts up. We ensure that stale jobs are marked as failed so that we have place for new jobs.
type StoreOption ¶
type StoreOption func(*Store)
StoreOption is an options provider for Store.
func SetDebug ¶
func SetDebug(enabled bool) StoreOption
SetDebug indicates whether to enable or disable debugging (which will output SQL to the console).
Click to show internal directories.
Click to hide internal directories.