workflowreport

package
v1.5.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(id string, dir string) context.Context

Context creates a new context with a Report value.

Types

type Report

type Report interface {
	// Creates a new stage with the given id. The previously active
	// stage (and its active substage) is marked as completed.
	// The newly created stage becomes the active one.
	Stage(id StageID) error
	// Store the given result for the specified stage.
	StageResult(id StageID, value string) error
	// Creates a new substage with the given id.
	// The subStageID must include the stage id owner of the current substage,
	// in the form of `<stage id>.<sub id>`, and the specified
	// stage must be active.
	// The previously active substage is marked as completed.
	// The newly created substage becomes the active one.
	SubStage(subID StageID) error
	// Store the given result for the specified substage.
	SubStageResult(subID StageID, value string) error
	// Marks the report as done. In case of error, exit code and error messages
	// are store in the report.
	// The currently active stage (and its active substage) is marked as completed.
	Complete(err error) error
}

Report is used to generate a detailed activity of the workflow. A report is composed by a number of sequential stages. A stage identifies a specific workflow phase, and can provide a detailed result as an output of its activity. A stage can be composed by any number of sequential substages. Any update on the report is immediately serialized on the disk.

func GetReport

func GetReport(ctx context.Context) Report

GetReport retrieves the Report instance from the given context. If not present, a nullRepo will be returned.

type StageID

type StageID interface {
	// The id of the stage.
	ID() string
	// A longer human-readable description of the stage.
	Description() string
}

StageID is an interface for the stage identifier.

func NewStageID

func NewStageID(id, desc string) StageID

NewStageID creates a new StageID instance.

Jump to

Keyboard shortcuts

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