stagetransaction

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, plan Plan) (result error)

Types

type Expectation

type Expectation struct {
	ExitStatus int      `json:"exit_status"`
	Signal     string   `json:"signal,omitempty"`
	Stdout     string   `json:"stdout"`
	Stderr     string   `json:"stderr"`
	Absent     []string `json:"absent,omitempty"`
}

type Plan

type Plan struct {
	EvidenceRoot string
	OutputLimit  int
	Stages       []Stage
	Cleanup      func() error
	// StageTimeout bounds one stage. A stage transaction publishes a receipt
	// that says what happened; a stage with no deadline can leave the
	// transaction with no receipt at all, which is the one outcome the design
	// has no way to describe.
	StageTimeout time.Duration
	// GracePeriod is how long a cancelled stage has to close its output before
	// its process group is killed. It exists because a stage can exit while a
	// grandchild it forked still holds stdout open, and waiting on that is
	// indistinguishable from a stage that has not finished.
	GracePeriod time.Duration
}

type Receipt

type Receipt struct {
	SchemaVersion  int    `json:"schema_version"`
	Sequence       int    `json:"sequence"`
	StageID        string `json:"stage_id"`
	Event          string `json:"event"`
	ArgvSHA256     string `json:"argv_sha256"`
	StartedUnixNS  int64  `json:"started_unix_ns,omitempty"`
	FinishedUnixNS int64  `json:"finished_unix_ns,omitempty"`
	ExitStatus     *int   `json:"exit_status,omitempty"`
	Signal         string `json:"signal,omitempty"`
	StdoutSHA256   string `json:"stdout_sha256,omitempty"`
	StderrSHA256   string `json:"stderr_sha256,omitempty"`
	Error          string `json:"error,omitempty"`
	RawError       string `json:"raw_error,omitempty"`
	VerifierOK     *bool  `json:"verifier_ok,omitempty"`
	VerifierError  string `json:"verifier_error,omitempty"`
}

type Stage

type Stage struct {
	ID      string       `json:"id"`
	Command string       `json:"command"`
	Args    []string     `json:"args,omitempty"`
	Dir     string       `json:"dir"`
	Env     []string     `json:"env,omitempty"`
	Expect  *Expectation `json:"expect,omitempty"`
}

Jump to

Keyboard shortcuts

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