status

package
v1.13.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package status defines the structured progress events emitted by long-running commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enter

func Enter(r Reporter, phase Phase, step string)

func Fail

func Fail(r Reporter, phase Phase, err error)

func Leave

func Leave(r Reporter, phase Phase, step string)

Types

type Event

type Event struct {
	Phase   Phase  `json:"phase"`
	Step    string `json:"step,omitempty"`
	Started bool   `json:"started"`
	Err     string `json:"error,omitempty"`
}

Event is one phase transition.

type Phase

type Phase string

Phase identifies a step in the up pipeline.

const (
	PhaseCloningRepository    Phase = "cloning_repository"
	PhaseResolvingConfig      Phase = "resolving_config"
	PhaseInitializeCommand    Phase = "initialize_command"
	PhaseBuildingImage        Phase = "building_image"
	PhaseStartingContainer    Phase = "starting_container"
	PhaseInjectingAgent       Phase = "injecting_agent"
	PhaseRunningLifecycleHook Phase = "running_lifecycle_hook"
	PhaseWaitingFor           Phase = "waiting_for"
	PhaseReady                Phase = "ready"
	PhaseFailed               Phase = "failed"
)

type Reporter

type Reporter interface {
	Report(Event)
}

Reporter receives status events as they occur. Implementations must be safe to call from goroutines.

func NewLogReporter

func NewLogReporter() Reporter

NewLogReporter returns a Reporter that logs each event at debug level.

func Nop

func Nop() Reporter

func Tee

func Tee(reporters ...Reporter) Reporter

Tee forwards every event to each reporter.

Jump to

Keyboard shortcuts

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