Documentation
¶
Index ¶
- type Mongo
- func (m *Mongo) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (m *Mongo) Close(ctx context.Context) error
- func (m *Mongo) CountEventsByJobID(ctx context.Context, jobID string) (int, error)
- func (m *Mongo) CountTasksByJobID(ctx context.Context, jobID string) (int, error)
- func (m *Mongo) CreateEvent(ctx context.Context, event *domain.Event) error
- func (m *Mongo) CreateJob(ctx context.Context, job *domain.Job) error
- func (m *Mongo) CreateTask(ctx context.Context, task *domain.Task) error
- func (m *Mongo) GetJob(ctx context.Context, jobID string) (*domain.Job, error)
- func (m *Mongo) GetJobEvents(ctx context.Context, jobID string, limit, offset int) ([]*domain.Event, int, error)
- func (m *Mongo) GetJobTasks(ctx context.Context, jobID string, limit, offset int) ([]*domain.Task, int, error)
- func (m *Mongo) GetJobs(ctx context.Context, limit, offset int) ([]*domain.Job, int, error)
- func (m *Mongo) GetJobsByConfig(ctx context.Context, jc *domain.JobConfig, limit, offset int) ([]*domain.Job, error)
- func (m *Mongo) GetJobsByConfigAndState(ctx context.Context, jc *domain.JobConfig, stateFilter []domain.JobState, ...) ([]*domain.Job, error)
- func (m *Mongo) Init(ctx context.Context) (err error)
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) CountEventsByJobID ¶ added in v0.12.0
CountEventsByJobID returns the total count of events for a job.
func (*Mongo) CountTasksByJobID ¶ added in v0.11.0
CountTasksByJobID returns the total count of tasks for a job.
func (*Mongo) CreateEvent ¶
CreateEvent creates a new event in the database.
func (*Mongo) CreateTask ¶ added in v0.12.0
CreateTask creates a new migration task.
func (*Mongo) GetJobEvents ¶ added in v0.12.0
func (m *Mongo) GetJobEvents(ctx context.Context, jobID string, limit, offset int) ([]*domain.Event, int, error)
GetJobEvents retrieves a list of migration events for a job with pagination.
func (*Mongo) GetJobTasks ¶ added in v0.11.0
func (m *Mongo) GetJobTasks(ctx context.Context, jobID string, limit, offset int) ([]*domain.Task, int, error)
GetJobTasks retrieves a list of migration tasks for a job with pagination.
func (*Mongo) GetJobs ¶ added in v0.10.0
GetJobs retrieves a list of migration jobs with pagination.
func (*Mongo) GetJobsByConfig ¶ added in v0.7.0
func (m *Mongo) GetJobsByConfig(ctx context.Context, jc *domain.JobConfig, limit, offset 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, limit, offset int) ([]*domain.Job, error)
GetJobsByConfigAndState retrieves jobs based on the provided job configuration and states.