bootengine

package
v2.7.1-0...-5f38440 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootProcess

type BootProcess struct {
	// Do not mutate these values from the outside, the mutability
	// is owned by BootProcess itself.
	CurrentState *types.State
	Log          Log
}

BootProcess represents an imaginary/virtual process of booting a machine. Given a flow it will replay all the expected actions, and it will be possible to analyze what happened in result.

func NewBootProcess

func NewBootProcess(state *types.State) *BootProcess

NewBootProcess returns a new instance of BootProcess.

func (*BootProcess) Finish

func (process *BootProcess) Finish(ctx context.Context)

Finish executes all the rest steps.

func (*BootProcess) NextStep

func (process *BootProcess) NextStep(ctx context.Context) bool

BootProcess executes the current step and switches to pointer to the next step.

func (*BootProcess) String

func (process *BootProcess) String() string

String implements fmt.Stringer.

type ErroredSteps

type ErroredSteps []*StepResult

ErroredSteps is an implementation of `error` given a log of errored steps.

func (ErroredSteps) As

func (s ErroredSteps) As(target any) bool

As implements errors.As.

func (ErroredSteps) Error

func (s ErroredSteps) Error() string

Error implements error.

func (ErroredSteps) Is

func (s ErroredSteps) Is(target error) bool

Is implements errors.Is.

type Log

type Log []StepResult

Log is a slice of StepResult.

func (Log) Error

func (log Log) Error() error

func (Log) GetDataMeasuredWith

func (log Log) GetDataMeasuredWith(trustChain types.TrustChain) types.MeasuredDataSlice

GetDataMeasuredWith returns all the data which was measured.

func (Log) IssuesCount

func (log Log) IssuesCount() uint

IssuesCount returns the total amount of issues.

func (Log) String

func (log Log) String() string

String implements fmt.Stringer.

type StepIssue

type StepIssue struct {
	Coords StepIssueCoords
	Issue  error
}

StepIssue is an error returned by a Step.

func (StepIssue) Error

func (err StepIssue) Error() string

Error implements the `error` interface.

func (StepIssue) String

func (err StepIssue) String() string

String implements fmt.Stringer.

func (StepIssue) Unwrap

func (err StepIssue) Unwrap() error

Unwrap enables support of go1.13 error unwrapping.

type StepIssueCoords

type StepIssueCoords any

StepIssueCoords helps to find a specific place where an issue occurred, within a types.Step.

Currently may contain either StepIssueCoordsActor or StepIssueCoordsAction.

type StepIssueCoordsAction

type StepIssueCoordsAction struct {
	ActionIndex uint
}

StepIssueCoordsAction implies that the issue happened during execution of an action with the defined index (the positional number within the types.Step).

func (StepIssueCoordsAction) String

func (i StepIssueCoordsAction) String() string

String implements fmt.Stringer.

type StepIssueCoordsActions

type StepIssueCoordsActions struct{}

StepIssueCoordsAction implies that the issue happened during getting Actions from the Step.

func (StepIssueCoordsActions) String

func (i StepIssueCoordsActions) String() string

String implements fmt.Stringer.

type StepIssueCoordsActor

type StepIssueCoordsActor struct{}

StepIssueCoordsActor implies that the issue happened during execution of Actor-specific logic (currently it is only method `ResponsibleCode`).

func (StepIssueCoordsActor) String

func (StepIssueCoordsActor) String() string

String implements fmt.Stringer.

type StepIssues

type StepIssues []StepIssue

StepIssues is a slice of StepIssue-s

type StepResult

type StepResult struct {
	Actor        types.Actor
	ActorCode    *types.Data
	Step         types.Step
	Actions      types.Actions
	MeasuredData types.MeasuredDataSlice
	Issues       StepIssues
}

StepResult is the outcome of a single Step execution.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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