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 ¶
Types ¶
type Event ¶
type Event struct {
Pipeline Pipeline `json:"pipeline,omitempty"`
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 a pipeline. PhaseReady and PhaseFailed are shared terminal phases.
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" )
Workspace up phases.
const ( PhaseInstallingProvider Phase = "installing_provider" PhaseResolvingOptions Phase = "resolving_options" PhaseRunningInit Phase = "running_init" )
Provider phases. Installing covers source resolution and binary download; ResolvingOptions and RunningInit are the two halves of provider init, split because only the latter executes provider-supplied code.
type Pipeline ¶
type Pipeline string
Pipeline identifies which command's progress an Event describes.
type Reporter ¶
type Reporter interface {
Report(Event)
}
Reporter receives status events as they occur. Implementations must be safe to call from goroutines.
func ForPipeline ¶
ForPipeline stamps every event a reporter receives with pipeline, so the Enter/Leave/Fail helpers stay pipeline-agnostic and each producer declares its pipeline once where it builds its reporter.
func NewLogReporter ¶
func NewLogReporter() Reporter
NewLogReporter returns a Reporter that logs each event at debug level.