phase

package
v0.4.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MPL-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 Phase

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

Phase represents a phase in the boot process.

func NewPhase

func NewPhase(description string, tasks ...Task) *Phase

NewPhase initializes and returns a Phase.

type Runner

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

Runner represents a management layer for phases.

func NewRunner

func NewRunner(config runtime.Configurator, sequence runtime.Sequence) (*Runner, error)

NewRunner initializes and returns a Runner.

func (*Runner) Add

func (r *Runner) Add(phase ...*Phase)

Add adds a phase to a Runner.

func (*Runner) Run

func (r *Runner) Run() error

Run executes sequentially all phases known to a Runner.

If any phase fails, Runner aborts immediately.

type RuntimeArgs added in v0.3.0

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

RuntimeArgs represents the set of arguments passed into a TaskFunc.

func (*RuntimeArgs) Config added in v0.3.0

func (r *RuntimeArgs) Config() runtime.Configurator

Config returns the config.

func (*RuntimeArgs) Platform added in v0.3.0

func (r *RuntimeArgs) Platform() runtime.Platform

Platform returns the platform.

type Task

type Task interface {
	TaskFunc(runtime.Mode) TaskFunc
}

Task represents a task within a Phase.

type TaskFunc added in v0.3.0

type TaskFunc func(runtime.Runtime) error

TaskFunc defines the function that a task must return. The function envelopes the task logic for a given runtime mode.

Directories

Path Synopsis
etc

Jump to

Keyboard shortcuts

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