precondition

package
v0.0.0-...-a45fa12 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Summarize

func Summarize(errs []error) error

Summarize summarizes all the precondition.Error from errs.

Types

type Error

type Error struct {
	Nested  error
	Reason  string
	Message string
	Name    string
}

Error is a wrapper for errors that occur during a precondition check for payload.

func (*Error) Cause

func (e *Error) Cause() error

Cause returns the nested error.

func (*Error) Error

func (e *Error) Error() string

Error returns the message

type List

type List []Precondition

List is a list of precondition checks.

func (List) RunAll

func (pfList List) RunAll(ctx context.Context) []error

RunAll runs all the reflight checks in order, returning a list of errors if any. All checks are run, regardless if any one precondition fails.

type Precondition

type Precondition interface {
	// Run executes the precondition checks ands returns an error when the precondition fails.
	Run(context.Context) error

	// Name returns a human friendly name for the precondition.
	Name() string
}

Precondition defines the precondition check for a payload.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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