mongo

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	config.MongoConfig

	Connection *mongodriver.MongoConnection
	// contains filtered or unexported fields
}

Mongo represents a mongo connection and health client

func (*Mongo) Checker

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

func (m *Mongo) Close(ctx context.Context) error

Close represents mongo session closing within the context deadline

func (*Mongo) CreateEvent

func (m *Mongo) CreateEvent(ctx context.Context, event *domain.Event) error

CreateEvent creates a new event in the database.

func (*Mongo) CreateJob

func (m *Mongo) CreateJob(ctx context.Context, job *domain.Job) error

CreateJob creates a new migration job.

func (*Mongo) GetJob

func (m *Mongo) GetJob(ctx context.Context, jobID string) (*domain.Job, error)

GetJob retrieves a job by its ID.

func (*Mongo) GetJobsByConfig added in v0.7.0

func (m *Mongo) GetJobsByConfig(ctx context.Context, jc *domain.JobConfig, offset, limit int) ([]*domain.Job, error)

GetJobsByConfig retrieves jobs based on the provided job configuration.

func (*Mongo) GetJobsByConfigAndState added in v0.7.0

func (m *Mongo) GetJobsByConfigAndState(ctx context.Context, jc *domain.JobConfig, stateFilter []domain.JobState, offset, limit int) ([]*domain.Job, error)

GetJobsByConfigAndState retrieves jobs based on the provided job configuration and states.

func (*Mongo) Init

func (m *Mongo) Init(ctx context.Context) (err error)

Init returns an initialised Mongo object encapsulating a connection to the mongo server/cluster with the given configuration, and a health client to check the health of the mongo server/cluster

Jump to

Keyboard shortcuts

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