Documentation ¶
Index ¶
- type Service
- func (rs Service) DeleteWorkflow(workflowName, workflowID string) error
- func (rs Service) Drop() error
- func (rs Service) GetAllWorkflows(excludeInactive bool) ([]w.Workflow, error)
- func (rs Service) GetWorkflow(workflowName, workflowID string) (w.OptionalWorkflow, error)
- func (rs Service) GetWorkflowFromPreffix(workflowName, workflowPreffix string) (w.OptionalWorkflow, error)
- func (rs Service) GetWorkflows(workflowName string, n int, excludeInactive bool) ([]w.Workflow, error)
- func (rs Service) PutWorkflow(workflow w.Workflow) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct{}
Service is the data structure from which to use the persistence methods
func (Service) DeleteWorkflow ¶
DeleteWorkflow takes a workflowName and workflowID and removes the workflow from the DB If the workflow or bucket does not exist, an error is returned
func (Service) GetAllWorkflows ¶
GetAllWorkflows returns a list of all workflows if excludeInactive is false. It returns all active workflows if excludeInactive is true. TODO: Unit test
func (Service) GetWorkflow ¶
func (rs Service) GetWorkflow(workflowName, workflowID string) (w.OptionalWorkflow, error)
GetWorkflow takes a workflowName and workflowID and returns the workflow which ID exactly matches the workflowID wrapped in an optional. If no workflow is found or the bucket does not exist, an empty optional is returned
func (Service) GetWorkflowFromPreffix ¶
func (rs Service) GetWorkflowFromPreffix(workflowName, workflowPreffix string) (w.OptionalWorkflow, error)
GetWorkflowFromPreffix takes a workflowName and workflowPreffix and returns a workflow which ID begins with the preffix wrapped in an optional. If no workflow is found or the bucket does not exist, an empty optional is returned TODO: Type alias
func (Service) GetWorkflows ¶
func (rs Service) GetWorkflows(workflowName string, n int, excludeInactive bool) ([]w.Workflow, error)
GetWorkflows takes a workflowName, an integer 'n' and whether or not inactive workflows are excluded and returns a list of 'n' workflows that match the criteria. If n is 0, all existing workflows that match the criteria are returned