plan

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package plan provides struts and functionality to use plans and actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Unique human readable short name of the action.
	// Please use names in lowercase and only alphanumeric symbols with underscore.
	// Names must be unique within a plan.
	// Example: dut_ping, dut_ssh, rpm_cycle, servod_echo.
	Name string
	// Name of the Exec function to use.
	// The name of action will be used if not provided.
	ExecName string
	// List of actions has to pass to allow start execution of this action.
	Dependencies []*Action
	// List of actions used to recover this action if it is fail.
	Recoveries []*Action
	// If set true then the action is allowed to fail without affecting the plan result.
	// If the action has recovery actions they will be tried and if action still fail it will be skipped.
	AllowFail bool
	// If set true then the action result will be cached and used for the next attempt.
	// If set false then action will run every time.
	AllowCache bool
}

Action represents a recovery action, which can perform either a verification action or a repair action.

func (*Action) Describe

func (a *Action) Describe(prefix string) string

Describe describes the action structure recursively.

type Plan

type Plan struct {
	// Unique name.
	// Can be used only predefined names of plans.
	Name string
	// List of verifiers used to determine success.
	Verifiers []*Action
	// If set true then the plan is allowed to fail without affecting the final result.
	AllowFail bool
}

Plan describes a recovery plan, including the verification actions used to determine success.

func (*Plan) Describe

func (p *Plan) Describe() string

Describe describes the plan details with verifiers.

func (*Plan) Run

func (p *Plan) Run(ctx context.Context, args *execs.RunArgs) error

Run runs the recovery plan.

Directories

Path Synopsis
Package execs provides collection of execution functions for actions and ability to execute them.
Package execs provides collection of execution functions for actions and ability to execute them.

Jump to

Keyboard shortcuts

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