Documentation
¶
Overview ¶
Package reporter holds the engine.Reporter implementations the CLI picks between at startup. There are two: PlainReporter for non-TTY use (CI, pipes, `NO_COLOR`, `--no-color`) and TTYReporter for interactive shells. The choice is made by Select and returned as the opaque engine.Reporter interface.
Index ¶
- func Select(opts Options) engine.Reporter
- type Options
- type PlainReporter
- func (r *PlainReporter) NodeCompleted(nodeID string, _ map[string]cty.Value, d time.Duration)
- func (r *PlainReporter) NodeFailed(nodeID string, err error)
- func (r *PlainReporter) NodeStarted(string)
- func (r *PlainReporter) RunCompleted(s engine.RunSummary)
- func (r *PlainReporter) RunStarted(scenario string)
- type TTYReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Out is the writer for user-visible output. Defaults to os.Stdout.
Out io.Writer
// ForcePlain forces PlainReporter regardless of TTY / env.
// Wired to the --no-color CLI flag.
ForcePlain bool
}
Options controls reporter selection. Zero value selects automatically from the environment.
type PlainReporter ¶
PlainReporter prints machine-friendly lines with no color or alignment. Used when stdout is a pipe, in CI, when NO_COLOR is set, or when --no-color is explicit. Output is intended to be greppable and stable across runs.
func (*PlainReporter) NodeCompleted ¶
NodeCompleted implements engine.Reporter.
func (*PlainReporter) NodeFailed ¶
func (r *PlainReporter) NodeFailed(nodeID string, err error)
NodeFailed implements engine.Reporter.
func (*PlainReporter) NodeStarted ¶
func (r *PlainReporter) NodeStarted(string)
NodeStarted implements engine.Reporter. Plain reporter stays silent on start — the completion line carries the timing and is enough signal for log consumers.
func (*PlainReporter) RunCompleted ¶
func (r *PlainReporter) RunCompleted(s engine.RunSummary)
RunCompleted implements engine.Reporter.
func (*PlainReporter) RunStarted ¶
func (r *PlainReporter) RunStarted(scenario string)
RunStarted implements engine.Reporter.
type TTYReporter ¶
TTYReporter produces styled output for interactive shells. Uses lipgloss via internal/cli/render; auto-degrades on terminals that don't support color via termenv.
func (*TTYReporter) NodeCompleted ¶
NodeCompleted implements engine.Reporter.
func (*TTYReporter) NodeFailed ¶
func (r *TTYReporter) NodeFailed(nodeID string, err error)
NodeFailed implements engine.Reporter.
func (*TTYReporter) NodeStarted ¶
func (r *TTYReporter) NodeStarted(string)
NodeStarted implements engine.Reporter. Currently silent — adding a pre-completion line is where live-progress would hook in; deferred for now.
func (*TTYReporter) RunCompleted ¶
func (r *TTYReporter) RunCompleted(s engine.RunSummary)
RunCompleted implements engine.Reporter.
func (*TTYReporter) RunStarted ¶
func (r *TTYReporter) RunStarted(scenario string)
RunStarted implements engine.Reporter.