repository

package
v0.0.0-...-3dfdb9c Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 NewService

func NewService() *Service

NewService creates and returns a Service instance

func (Service) DeleteWorkflow

func (rs Service) DeleteWorkflow(workflowName, workflowID string) error

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

func (rs Service) Drop() error

Drop wipes the DB clean

func (Service) GetAllWorkflows

func (rs Service) GetAllWorkflows(excludeInactive bool) ([]w.Workflow, error)

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

func (Service) PutWorkflow

func (rs Service) PutWorkflow(workflow w.Workflow) error

PutWorkflow takes a workflow.Workflow struct and saves it into the DB

Jump to

Keyboard shortcuts

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