store

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	Backend Storer
}

Datastore provides a datastore.Storer interface used to store, retrieve, remove or update bundles

func (*Datastore) ClaimJob added in v0.15.0

func (ds *Datastore) ClaimJob(ctx context.Context, pendingState, activeState domain.State) (*domain.Job, error)

ClaimJob claims a pending job for processing.

func (*Datastore) ClaimTask added in v0.15.0

func (ds *Datastore) ClaimTask(ctx context.Context, pendingState, activeState domain.State) (*domain.Task, error)

ClaimTask claims a pending task for processing.

func (*Datastore) CountEventsByJobNumber added in v0.19.0

func (ds *Datastore) CountEventsByJobNumber(ctx context.Context, jobNumber int) (int, error)

CountEventsByJobNumber returns the total count of events for a job.

func (*Datastore) CountTasksByJobNumber added in v0.19.0

func (ds *Datastore) CountTasksByJobNumber(ctx context.Context, jobNumber int) (int, error)

CountTasksByJobNumber returns the total count of tasks for a job.

func (*Datastore) CreateEvent added in v0.12.0

func (ds *Datastore) CreateEvent(ctx context.Context, event *domain.Event) error

CreateEvent creates a new migration event.

func (*Datastore) CreateJob

func (ds *Datastore) CreateJob(ctx context.Context, job *domain.Job) error

CreateJob creates a new migration job.

func (*Datastore) CreateTask added in v0.12.0

func (ds *Datastore) CreateTask(ctx context.Context, task *domain.Task) error

CreateTask creates a new migration task.

func (*Datastore) GetJob

func (ds *Datastore) GetJob(ctx context.Context, jobNumber int) (*domain.Job, error)

GetJob retrieves a job by its job number.

func (*Datastore) GetJobEvents added in v0.12.0

func (ds *Datastore) GetJobEvents(ctx context.Context, jobNumber, limit, offset int) ([]*domain.Event, int, error)

GetJobEvents retrieves a list of migration events for a job with pagination.

func (*Datastore) GetJobStateCounts added in v1.1.0

func (ds *Datastore) GetJobStateCounts(ctx context.Context, labelQuery string) ([]mongo.StateCountResult, error)

GetJobStateCounts retrieves a summary of job counts by state, sorted by count descending.

func (*Datastore) GetJobTasks added in v0.11.0

func (ds *Datastore) GetJobTasks(ctx context.Context, states []domain.State, jobNumber, limit, offset int) ([]*domain.Task, int, error)

GetJobTasks retrieves a list of migration tasks for a job with pagination.

func (*Datastore) GetJobs added in v0.10.0

func (ds *Datastore) GetJobs(ctx context.Context, field sort.SortParameterField, direction sort.SortParameterDirection, states []domain.State, labelQuery string, limit, offset int) ([]*domain.Job, int, error)

GetJobs retrieves a list of migration jobs with pagination.

func (*Datastore) GetJobsBySourceOrTargetAndState added in v0.35.1

func (ds *Datastore) GetJobsBySourceOrTargetAndState(ctx context.Context, jc *domain.JobConfig, states []domain.State, limit, offset int) ([]*domain.Job, error)

GetJobsBySourceOrTargetAndState retrieves jobs based on the provided source ID or target ID and states.

func (*Datastore) GetNextJobNumberCounter added in v0.19.0

func (ds *Datastore) GetNextJobNumberCounter(ctx context.Context) (*domain.Counter, error)

GetNextJobNumberCounter increments the job number counter, in mongoDB, and then returns it.

func (*Datastore) GetTask added in v0.15.0

func (ds *Datastore) GetTask(ctx context.Context, taskID string) (*domain.Task, error)

GetTask retrieves a migration task.

func (*Datastore) UpdateJob added in v0.15.0

func (ds *Datastore) UpdateJob(ctx context.Context, job *domain.Job) error

UpdateJob updates an existing migration job.

func (*Datastore) UpdateJobState added in v0.20.0

func (ds *Datastore) UpdateJobState(ctx context.Context, jobID string, oldState, newState domain.State, lastUpdated time.Time) error

UpdateJobState updates the state of a migration job.

func (*Datastore) UpdateTask added in v0.15.0

func (ds *Datastore) UpdateTask(ctx context.Context, task *domain.Task) error

UpdateTask updates an existing migration task.

func (*Datastore) UpdateTaskState added in v0.20.0

func (ds *Datastore) UpdateTaskState(ctx context.Context, taskID string, newState domain.State, lastUpdated time.Time) error

UpdateTaskState updates the state of a migration task.

type MongoDB

type MongoDB interface {
	Close(context.Context) error
	Checker(context.Context, *healthcheck.CheckState) error
	// contains filtered or unexported methods
}

MongoDB represents all the required methods from mongoDB

type Storer

type Storer interface {
	// contains filtered or unexported methods
}

Storer represents basic data access via Get, Remove and Upsert methods, abstracting it from mongoDB or graphDB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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