itinerary

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StepNotFound = errors.New("step not found")
)

Errors.

Functions

This section is empty.

Types

type Flag

type Flag = int16

Predicate flag.

type Itinerary

type Itinerary struct {
	// Pipeline (list) of steps.
	Pipeline
	// Predicate.
	Predicate
	// Name.
	Name string
}

An itinerary. List of conditional steps.

func (*Itinerary) First

func (r *Itinerary) First() (step Step, err error)

Get the first step filtered by predicate.

func (*Itinerary) Get

func (r *Itinerary) Get(name string) (step Step, err error)

Get a step by name.

func (*Itinerary) List

func (r *Itinerary) List() (pipeline Pipeline, err error)

List of steps filtered by predicates.

func (*Itinerary) Next

func (r *Itinerary) Next(name string) (next Step, done bool, err error)

Get the next step in the itinerary.

func (*Itinerary) Progress

func (r *Itinerary) Progress(step string) (report Progress, err error)

Build a progress report.

type Pipeline

type Pipeline []Step

List of steps.

type Predicate

type Predicate interface {
	// Evaluate the condition.
	// Returns (true) when the step should be included.
	Evaluate(Flag) (bool, error)
}

Predicate. Flags delegated to the predicate.

type Progress

type Progress struct {
	// Completed units.
	Completed int64 `json:"completed"`
	// Total units.
	Total int64 `json:"total"`
}

Progress report.

type Step

type Step struct {
	// Name.
	Name string
	// Any of these conditions be satisfied for
	// the step to be included.
	All Flag
	// All of these conditions be satisfied for
	// the step to be included.
	Any Flag
}

Itinerary step.

Jump to

Keyboard shortcuts

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