Documentation
¶
Overview ¶
Package progress provides a minimal reporter interface for the scanner to emit host-level progress updates. A TTY-backed implementation renders a progress bar on stderr using github.com/schollz/progressbar/v3; the Noop implementation is used when stderr is not a TTY so piping JSON/grep output stays clean.
Reporters are goroutine-safe (schollz/progressbar is), so the scanner can call them from its per-host workers without extra locking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reporter ¶
type Reporter interface {
// SetTotal declares the expected total count when known. Calling with
// a non-positive value switches the reporter to indeterminate mode.
SetTotal(n int64)
// Tick records one unit of progress.
Tick()
// Finish flushes any trailing output (newline after the bar).
Finish()
}
Reporter emits progress updates. All methods must be safe for concurrent use from scanner workers.
func New ¶
New returns a stderr-backed bar when stderr is a TTY, otherwise Noop. Options:
- description shown before the bar (e.g., "scanning")
- force: when true, emit the bar even if stderr is not a TTY (useful for tests / logs). force=false is the normal runtime path.
Click to show internal directories.
Click to hide internal directories.