validate

package
v0.0.0-...-98ba599 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Validate package contains validation functions for the common structures used in the workflow engine, such as Workflows, Tasks, WorkflowInvocations, etc.

All validate functions return either nil (value is valid) or a validate.Error (value is invalid).

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrObjectEmpty                  = errors.New("no object provided")
	ErrInvalidAPIVersion            = errors.New("unknown API version")
	ErrWorkflowWithoutTasks         = errors.New("workflow needs at least one task")
	ErrUndefinedDependency          = errors.New("task contains undefined dependency")
	ErrTaskIDMissing                = errors.New("task misses an id")
	ErrTaskNotUnique                = errors.New("task is not unique")
	ErrWorkflowWithoutStartTasks    = errors.New("workflow does not contain any start tasks (tasks with 0 dependencies)")
	ErrTaskRequiresFnRef            = errors.New("task requires a function name")
	ErrCircularDependency           = errors.New("workflow contains circular dependency")
	ErrInvalidOutputTask            = errors.New("unknown output task")
	ErrNoParentTaskDependency       = errors.New("dynamic task does not contain parent dependency")
	ErrMultipleParentTaskDependency = errors.New("dynamic task contains multiple parent tasks")
	ErrNoWorkflowInvocation         = errors.New("workflow invocation id is required")
	ErrNoTaskInvocation             = errors.New("task invocation id is required")
	ErrNoFnRef                      = errors.New("function reference is required")
	ErrNoWorkflow                   = errors.New("workflow id is required")
	ErrNoID                         = errors.New("id is required")
	ErrNoStatus                     = errors.New("status is required")
)

Functions

func DynamicTaskSpec

func DynamicTaskSpec(task *types.TaskSpec) error

func Flow

func Flow(flow controlflow.Flow) error

func Format

func Format(rawErr error) string

Format is an utility for printing the error hierarchies of Error

func FormatConcise

func FormatConcise(rawErr error) string

FormatConcise returns a single line description of the errors.

func NewError

func NewError(subject string, errs ...error) error

func ObjectMetadata

func ObjectMetadata(o *types.ObjectMetadata) error

func Task

func Task(task *types.Task) error

func TaskInvocationSpec

func TaskInvocationSpec(spec *types.TaskInvocationSpec) error

func TaskSpec

func TaskSpec(spec *types.TaskSpec) error

func WorkflowInvocationSpec

func WorkflowInvocationSpec(spec *types.WorkflowInvocationSpec) error

func WorkflowSpec

func WorkflowSpec(spec *types.WorkflowSpec) error

WorkflowSpec validates the Workflow Specification.

Types

type Error

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

func (Error) Contains

func (ie Error) Contains(err error) bool

func (Error) Error

func (ie Error) Error() string

func (Error) Reasons

func (ie Error) Reasons() []error

Jump to

Keyboard shortcuts

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