plans

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package plans holds the predefined kinds of plan: for each, what one run of such a plan does, for the plan manager to run inside a run's bookkeeping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

Command is a plan of entity.PlanKindCommand: each run is the plan's jobs.Command.

func NewCommand

func NewCommand(plan *entity.Plan) (Command, error)

NewCommand reads a command plan, whose Params is a jobs.Command; its Out is the plan manager's, set for each run.

func (Command) Header

func (c Command) Header() string

Header heads each run's log: the command line.

func (Command) Run

func (c Command) Run(jc job.Context, out io.Writer) (Outcome, error)

Run runs the command once, writing its output to out, and says how the run ended. Its error is the command's.

type Outcome

type Outcome struct {
	State    entity.PlanRunState
	Error    string // why it failed, or what stopped it
	ExitCode int    // for a kind with an exit status, like a command; 0 for one without
}

Outcome is the part of a PlanRun that the plan's kind decides as one of its runs ends; the plan manager fills in the rest. Every kind gives a State and, unless it succeeded, an Error.

Jump to

Keyboard shortcuts

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