mongodb

package
v0.2.1-0...-9c16218 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

Connection is an active connection to a MongoDB database.

func NewConnection

func NewConnection(ctx context.Context, mongoURI, dbName string) (c *Connection, err error)

NewConnection opens a new connection to a MongoDB database.

func (*Connection) CreateJob

func (c *Connection) CreateJob(ctx context.Context, j core.Job) (core.Job, error)

CreateJob creates a new job. If an ID is provided in j, it is ignored and replaced with a unique identifier in the returned job.

func (*Connection) CreateVolume

func (c *Connection) CreateVolume(ctx context.Context, v core.Volume) (core.Volume, error)

CreateVolume creates a new volume. If an ID is provided in v, it is ignored and replaced with a unique identifier in the returned volume.

func (*Connection) CreateWorkflow

func (c *Connection) CreateWorkflow(ctx context.Context, w core.Workflow) (core.Workflow, error)

CreateWorkflow creates a new workflow. If an ID is provided in w, it is ignored and replaced with a unique identifier in the returned workflow.

func (*Connection) DeleteJobsByWorkflowID

func (c *Connection) DeleteJobsByWorkflowID(ctx context.Context, wid string) error

DeleteJobsByWorkflowID deletes jobs with the given workflow ID.

func (*Connection) DeleteVolumesByWorkflowID

func (c *Connection) DeleteVolumesByWorkflowID(ctx context.Context, wid string) error

DeleteVolumesByWorkflowID deletes volumes with the given workflow ID.

func (*Connection) DeleteWorkflow

func (c *Connection) DeleteWorkflow(ctx context.Context, id string) (w core.Workflow, err error)

DeleteWorkflow deletes a workflow by ID. If the supplied ID is not valid, or there there is not a workflow with a matching ID in the database, an error is returned.

func (*Connection) Disconnect

func (c *Connection) Disconnect(ctx context.Context) error

Disconnect disconnects from the MongoDB database.

func (*Connection) GetJob

func (c *Connection) GetJob(ctx context.Context, id string) (j core.Job, err error)

GetJob retrieves a job by ID. If the supplied ID is not valid, or there there is not a job with a matching ID in the database, an error is returned.

func (*Connection) GetJobs

func (c *Connection) GetJobs(ctx context.Context, pa core.PageArgs) (p core.JobsPage, err error)

GetJobs returns a list of all jobs.

func (*Connection) GetJobsByID

func (c *Connection) GetJobsByID(ctx context.Context, pa core.PageArgs, wid string, ids []string) (p core.JobsPage, err error)

GetJobsByID returns a list of jobs by name within a given workflow.

func (*Connection) GetJobsByWorkflowID

func (c *Connection) GetJobsByWorkflowID(ctx context.Context, pa core.PageArgs, wid string) (p core.JobsPage, err error)

GetJobsByWorkflowID returns a list of all jobs for a given workflow.

func (*Connection) GetVolumes

func (c *Connection) GetVolumes(ctx context.Context, pa core.PageArgs) (p core.VolumesPage, err error)

GetVolumes returns a list of all volumes.

func (*Connection) GetVolumesByWorkflowID

func (c *Connection) GetVolumesByWorkflowID(ctx context.Context, pa core.PageArgs, wid string) (p core.VolumesPage, err error)

GetVolumesByWorkflowID returns a list of all volumes required for a given workflow.

func (*Connection) GetWorkflow

func (c *Connection) GetWorkflow(ctx context.Context, id string) (w core.Workflow, err error)

GetWorkflow retrieves a workflow by ID. If the supplied ID is not valid, or there there is not a workflow with a matching ID in the database, an error is returned.

func (*Connection) GetWorkflows

func (c *Connection) GetWorkflows(ctx context.Context, pa core.PageArgs) (p core.WorkflowsPage, err error)

GetWorkflows returns a list of all workflows.

func (*Connection) SetJobExitCode

func (c *Connection) SetJobExitCode(ctx context.Context, id string, exitCode int) error

SetJobExitCode updates a job's exit status. If the supplied ID is not valid, or there there is not a job with a matching ID in the database, an error is returned.

func (*Connection) SetJobStatus

func (c *Connection) SetJobStatus(ctx context.Context, id, status string) error

SetJobStatus updates a job's status. If the supplied ID is not valid, or there there is not a job with a matching ID in the database, an error is returned.

func (*Connection) SetWorkflowStatus

func (c *Connection) SetWorkflowStatus(ctx context.Context, id, status string) (err error)

SetWorkflowStatus updates a workflow's status. If the supplied ID is not valid, or there there is not a workflow with a matching ID in the database, an error is returned.

Jump to

Keyboard shortcuts

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