Documentation
¶
Overview ¶
Package output renders per-host scan results in one of several formats. Writers are streaming: the scanner calls WriteHost as each host result arrives, and End flushes any trailer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Service ¶
Service returns a best-guess canonical service name for the given TCP port, or "" if the port is not in the IANA registry.
func ShouldColor ¶
ShouldColor decides whether ANSI styling should be used for w.
- forced true → always on.
- forced false → always off.
- auto → on when w is an *os.File pointing at a TTY AND NO_COLOR is not set. https://no-color.org/
Types ¶
type Format ¶
type Format string
Format selects the renderer.
func ParseFormat ¶
ParseFormat maps a user string to a Format.
type Options ¶
type Options struct {
// Color enables ANSI styling in the human writer. Ignored by json/grep.
Color bool
// Verbose is 0 (open only), 1 (+ closed/filtered), 2 (+ errors).
Verbose int
}
Options tunes writer rendering.
type Writer ¶
type Writer interface {
// Begin is called once before any WriteHost. Implementations may
// emit a header or set up state.
Begin() error
// WriteHost renders a single host's result.
WriteHost(hr portscan.HostResult) error
// End is called once after the last WriteHost. Use it to flush
// trailers (e.g., a summary line).
End() error
}
Writer is the streaming output interface.
Click to show internal directories.
Click to hide internal directories.