go.bigb.es/auxilia
Documentation
Types
type AutoPrompter bool
AutoPrompter is a non-interactive prompter that answers every Confirm with a fixed boolean and every Select with the first option.
func (a AutoPrompter) Confirm(context.Context, string) (bool, error)
Confirm returns the configured fixed answer.
func (AutoPrompter) Select(_ context.Context, _ string, options []string) (int, error)
Select always picks the first option.
type CLIPrompter struct { In io.Reader Out io.Writer // contains filtered or unexported fields }
CLIPrompter answers interactive questions by reading from In and writing prompts to Out. It never touches os.Stdin/os.Stdout directly (PC2).
func (p *CLIPrompter) Confirm(_ context.Context, question string) (bool, error)
Confirm asks a yes/no question. An empty or unrecognized answer is treated as "no". A read error before any input is returned.
func (p *CLIPrompter) Select(_ context.Context, question string, options []string) (int, error)
Select presents numbered options and reads a 1-based choice, returning the 0-based index. A non-numeric or out-of-range answer is an error.
type TextReporter struct { W io.Writer Color bool }
TextReporter writes per-step progress lines and a final summary to W. When Color is set, glyphs are wrapped in ANSI color codes.
func (r *TextReporter) FlowDone(host string, res legatus.FlowResult)
FlowDone reports the aggregate status of a flow on a host.
func (r *TextReporter) FlowStart(host, flow string)
FlowStart announces the start of a flow on a host.
func (r *TextReporter) RunDone(res legatus.RunResult)
RunDone writes the final tally across all hosts.
func (r *TextReporter) StepDone(host string, res legatus.StepResult)
StepDone reports the outcome of a step with a status glyph.
func (r *TextReporter) StepStart(host, step string)
StepStart announces a step about to run on a host.
Package report provides human-facing implementations of the legatus Reporter and Prompter interfaces: a text progress reporter and CLI/auto prompters. These are the injectable interactivity/progress impls (PC2): self-contained, no globals, no direct os.Stdin/os.Stdout access — all I/O flows through the configured readers and writers.