Documentation ¶
Index ¶
- type Mongo
- func (m *Mongo) AcquireInstanceLock(ctx context.Context, jobID string) (lockID string, err error)
- func (m *Mongo) AddJob(ctx context.Context, job *models.Job) (*models.Job, error)
- func (m *Mongo) AddUploadedFile(ctx context.Context, id string, file *models.UploadedFile) error
- func (m *Mongo) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (m *Mongo) Close(ctx context.Context) error
- func (m *Mongo) GetJob(ctx context.Context, id string) (*models.Job, error)
- func (m *Mongo) GetJobs(ctx context.Context, filters []string, offset int, limit int) (*models.JobResults, error)
- func (m *Mongo) UnlockInstance(ctx context.Context, lockID string)
- func (m *Mongo) UpdateJob(ctx context.Context, id string, job *models.Job) (err error)
- func (m *Mongo) UpdateProcessedInstance(ctx context.Context, id string, procInstances []models.ProcessedInstances) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
type Mongo struct { mongodriver.MongoDriverConfig // contains filtered or unexported fields }
func NewDatastore ¶
NewDatastore creates a new mongodb.MongoConnection with the given configuration
func (*Mongo) AcquireInstanceLock ¶ added in v1.18.0
AcquireInstanceLock tries to lock the provided jobID. If the job is already locked, this function will block until it's released, at which point we acquire the lock and return. Note: the lock is currently only used to update processed_instances
func (*Mongo) AddUploadedFile ¶
AddUploadedFile adds an UploadedFile to an import job
func (*Mongo) Checker ¶ added in v1.9.0
func (m *Mongo) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker is called by the healthcheck library to check the health state of this mongoDB instance
func (*Mongo) GetJobs ¶
func (m *Mongo) GetJobs(ctx context.Context, filters []string, offset int, limit int) (*models.JobResults, error)
GetJobs retrieves all import documents matching filters
func (*Mongo) UnlockInstance ¶ added in v1.18.0
UnlockInstance releases an exclusive mongoDB lock for the provided lockId (if it exists) Note: the lock is currently only used to update processed_instances
func (*Mongo) UpdateProcessedInstance ¶ added in v1.18.0
func (m *Mongo) UpdateProcessedInstance(ctx context.Context, id string, procInstances []models.ProcessedInstances) (err error)
UpdateProcessedInstance overides the processed instances for an existing import job