Documentation ¶
Index ¶
- type Connection
- func (c *Connection) CreateJob(ctx context.Context, j core.Job) (core.Job, error)
- func (c *Connection) CreateVolume(ctx context.Context, v core.Volume) (core.Volume, error)
- func (c *Connection) CreateWorkflow(ctx context.Context, w core.Workflow) (core.Workflow, error)
- func (c *Connection) DeleteJobsByWorkflowID(ctx context.Context, wid string) error
- func (c *Connection) DeleteVolumesByWorkflowID(ctx context.Context, wid string) error
- func (c *Connection) DeleteWorkflow(ctx context.Context, id string) (w core.Workflow, err error)
- func (c *Connection) Disconnect(ctx context.Context) error
- func (c *Connection) GetJob(ctx context.Context, id string) (j core.Job, err error)
- func (c *Connection) GetJobs(ctx context.Context, pa core.PageArgs) (p core.JobsPage, err error)
- func (c *Connection) GetJobsByID(ctx context.Context, pa core.PageArgs, wid string, ids []string) (p core.JobsPage, err error)
- func (c *Connection) GetJobsByWorkflowID(ctx context.Context, pa core.PageArgs, wid string) (p core.JobsPage, err error)
- func (c *Connection) GetVolumes(ctx context.Context, pa core.PageArgs) (p core.VolumesPage, err error)
- func (c *Connection) GetVolumesByWorkflowID(ctx context.Context, pa core.PageArgs, wid string) (p core.VolumesPage, err error)
- func (c *Connection) GetWorkflow(ctx context.Context, id string) (w core.Workflow, err error)
- func (c *Connection) GetWorkflows(ctx context.Context, pa core.PageArgs) (p core.WorkflowsPage, err error)
- func (c *Connection) SetJobExitCode(ctx context.Context, id string, exitCode int) error
- func (c *Connection) SetJobStatus(ctx context.Context, id, status string) error
- func (c *Connection) SetWorkflowStatus(ctx context.Context, id, status string) (err error)
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) 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 ¶
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 ¶
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.