Documentation
¶
Index ¶
- Variables
- func CheckJobCompleteAndCleanup(ctx context.Context, r repository.Repository, jobID uint) (jobCompleted bool, err error)
- func CloseOrLogError(logger logrus.FieldLogger, f *os.File)
- func CreateDir(path string) error
- type JobError
- type MockWorker
- type MockWorker_Expecter
- type MockWorker_ProcessJob_Call
- func (_c *MockWorker_ProcessJob_Call) Return(err error) *MockWorker_ProcessJob_Call
- func (_c *MockWorker_ProcessJob_Call) Run(run func(ctx context.Context, queJobID int64, job models.Job, ...)) *MockWorker_ProcessJob_Call
- func (_c *MockWorker_ProcessJob_Call) RunAndReturn(run func(ctx context.Context, queJobID int64, job models.Job, ...) error) *MockWorker_ProcessJob_Call
- type MockWorker_ValidateJob_Call
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoBasePathSet = JobError{"empty BBBasePath: Must be set"} ErrParentJobNotFound = JobError{"parent job not found"} ErrParentJobCancelled = JobError{"parent job cancelled"} ErrParentJobFailed = JobError{"parent job failed"} ErrQueJobProcessed = JobError{"que job already processed"} )
Functions ¶
func CheckJobCompleteAndCleanup ¶
func CheckJobCompleteAndCleanup(ctx context.Context, r repository.Repository, jobID uint) (jobCompleted bool, err error)
func CloseOrLogError ¶
func CloseOrLogError(logger logrus.FieldLogger, f *os.File)
Types ¶
type MockWorker ¶
MockWorker is an autogenerated mock type for the Worker type
func NewMockWorker ¶
func NewMockWorker(t interface {
mock.TestingT
Cleanup(func())
}) *MockWorker
NewMockWorker creates a new instance of MockWorker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockWorker) EXPECT ¶
func (_m *MockWorker) EXPECT() *MockWorker_Expecter
func (*MockWorker) ProcessJob ¶
func (_mock *MockWorker) ProcessJob(ctx context.Context, queJobID int64, job models.Job, jobArgs worker_types.JobEnqueueArgs) error
ProcessJob provides a mock function for the type MockWorker
func (*MockWorker) ValidateJob ¶
func (_mock *MockWorker) ValidateJob(ctx context.Context, queJobID int64, jobArgs worker_types.JobEnqueueArgs) (*models.Job, error)
ValidateJob provides a mock function for the type MockWorker
type MockWorker_Expecter ¶
type MockWorker_Expecter struct {
// contains filtered or unexported fields
}
func (*MockWorker_Expecter) ProcessJob ¶
func (_e *MockWorker_Expecter) ProcessJob(ctx any, queJobID any, job any, jobArgs any) *MockWorker_ProcessJob_Call
ProcessJob is a helper method to define mock.On call
- ctx context.Context
- queJobID int64
- job models.Job
- jobArgs worker_types.JobEnqueueArgs
func (*MockWorker_Expecter) ValidateJob ¶
func (_e *MockWorker_Expecter) ValidateJob(ctx any, queJobID any, jobArgs any) *MockWorker_ValidateJob_Call
ValidateJob is a helper method to define mock.On call
- ctx context.Context
- queJobID int64
- jobArgs worker_types.JobEnqueueArgs
type MockWorker_ProcessJob_Call ¶
MockWorker_ProcessJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessJob'
func (*MockWorker_ProcessJob_Call) Return ¶
func (_c *MockWorker_ProcessJob_Call) Return(err error) *MockWorker_ProcessJob_Call
func (*MockWorker_ProcessJob_Call) Run ¶
func (_c *MockWorker_ProcessJob_Call) Run(run func(ctx context.Context, queJobID int64, job models.Job, jobArgs worker_types.JobEnqueueArgs)) *MockWorker_ProcessJob_Call
func (*MockWorker_ProcessJob_Call) RunAndReturn ¶
func (_c *MockWorker_ProcessJob_Call) RunAndReturn(run func(ctx context.Context, queJobID int64, job models.Job, jobArgs worker_types.JobEnqueueArgs) error) *MockWorker_ProcessJob_Call
type MockWorker_ValidateJob_Call ¶
MockWorker_ValidateJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateJob'
func (*MockWorker_ValidateJob_Call) Return ¶
func (_c *MockWorker_ValidateJob_Call) Return(job *models.Job, err error) *MockWorker_ValidateJob_Call
func (*MockWorker_ValidateJob_Call) Run ¶
func (_c *MockWorker_ValidateJob_Call) Run(run func(ctx context.Context, queJobID int64, jobArgs worker_types.JobEnqueueArgs)) *MockWorker_ValidateJob_Call
func (*MockWorker_ValidateJob_Call) RunAndReturn ¶
func (_c *MockWorker_ValidateJob_Call) RunAndReturn(run func(ctx context.Context, queJobID int64, jobArgs worker_types.JobEnqueueArgs) (*models.Job, error)) *MockWorker_ValidateJob_Call
type Worker ¶
type Worker interface {
ValidateJob(ctx context.Context, queJobID int64, jobArgs worker_types.JobEnqueueArgs) (*models.Job, error)
ProcessJob(ctx context.Context, queJobID int64, job models.Job, jobArgs worker_types.JobEnqueueArgs) error
}