worker

package
v0.0.0-...-a4b8a28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2024 License: CC0-1.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 AlrWorker

type AlrWorker struct {
	*postgres.AlrRepository
	repository.Repository
	StagingDir string `conf:"FHIR_STAGING_DIR"`
}

func NewAlrWorker

func NewAlrWorker(db *sql.DB) AlrWorker

func (*AlrWorker) ProcessAlrJob

func (a *AlrWorker) ProcessAlrJob(
	ctx context.Context,
	queJobID int64,
	jobArgs models.JobAlrEnqueueArgs,
) error

ProcessAlrJob is a function called by the Worker to serve ALR data to users

type JobError

type JobError struct {
	ErrorString string
}

func (JobError) Error

func (je JobError) Error() string

type MockWorker

type MockWorker struct {
	mock.Mock
}

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) ProcessJob

func (_m *MockWorker) ProcessJob(ctx context.Context, queJobID int64, job models.Job, jobArgs models.JobEnqueueArgs) error

ProcessJob provides a mock function with given fields: ctx, queJobID, job, jobArgs

func (*MockWorker) ValidateJob

func (_m *MockWorker) ValidateJob(ctx context.Context, queJobID int64, jobArgs models.JobEnqueueArgs) (*models.Job, error)

ValidateJob provides a mock function with given fields: ctx, queJobID, jobArgs

type Worker

type Worker interface {
	ValidateJob(ctx context.Context, queJobID int64, jobArgs models.JobEnqueueArgs) (*models.Job, error)
	ProcessJob(ctx context.Context, queJobID int64, job models.Job, jobArgs models.JobEnqueueArgs) error
}

func NewWorker

func NewWorker(db *sql.DB) Worker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL