report

package
v0.2.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package report renders scan results into shareable Markdown and HTML documents, surfacing the service/version/TLS/risk intel that the table and tree views keep compact. Both formats are built from the same Report struct so they stay in sync.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanOpen

func CanOpen() bool

CanOpen reports whether opening a file in the desktop default app is supported and enabled. Setting NDSCAN_NO_OPEN disables it (for headless runs, CI, and tests).

func ExportDir

func ExportDir(at time.Time) string

ExportDir returns the directory exports are written to for a given time: ~/Downloads/ndscan/<YYYY-MM-DD>. NDSCAN_EXPORT_DIR overrides the base (~/Downloads/ndscan) — used by tests and for a custom location.

func ExportPath

func ExportPath(at time.Time, format string) (string, error)

ExportPath builds the full path for an export of the given format at time `at`, creating the dated directory if needed. It returns the path to write.

Names are second-resolution, so two exports of the same format within one second would collide; the second and later get a "-2", "-3", … suffix rather than silently overwriting the earlier file.

func Open

func Open(path string) error

Open launches path in the OS default application (e.g. a browser for HTML). It is best-effort: when unsupported or disabled it returns nil without doing anything, so callers never need to special-case the environment.

Types

type Finding

type Finding struct {
	IP       string
	Host     string
	Port     int
	Service  string
	Severity string
	Reason   string
}

Finding is one host/port flagged by the risk engine, for the exposure list.

type Report

type Report struct {
	Targets   string // e.g. "192.168.86.0/24"
	Preset    string // quick|default|udp|deep
	Generated string // caller-supplied human-readable timestamp
	Rows      []ui.Row
}

Report is the input to the renderers: the scanned rows plus context.

func (Report) HTML

func (r Report) HTML() string

HTML renders the report as a self-contained dark-themed HTML document with inline CSS (no external assets), so it can be opened or emailed as-is.

func (Report) Markdown

func (r Report) Markdown() string

Markdown renders the report as a GitHub-flavored Markdown document.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL