report

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package report renders an inventory as text, JSON or NDJSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlowLine

func FlowLine(r *inventory.Record) string

FlowLine renders one record as a single line, for live capture where the interesting thing is what just happened rather than a distribution.

func SortRecords

func SortRecords(records []*inventory.Record)

SortRecords orders records by severity then by time, so the most alarming handshake is the first thing a reader sees.

func WriteCBOM

func WriteCBOM(w io.Writer, r *Report, records []*inventory.Record) error

WriteCBOM renders the inventory as a CycloneDX 1.6 CBOM.

func WriteHTML

func WriteHTML(w io.Writer, r *Report, records []*inventory.Record) error

WriteHTML renders a self-contained report page.

func WriteJSON

func WriteJSON(w io.Writer, r *Report) error

WriteJSON renders the whole report as indented JSON.

func WriteLiveHTML

func WriteLiveHTML(w io.Writer, r *Report, records []*inventory.Record, refreshSeconds int) error

WriteLiveHTML renders the page with a refresh interval, for a capture still in progress.

func WriteNDJSON

func WriteNDJSON(w io.Writer, records []*inventory.Record) error

WriteNDJSON renders one record per line. This is the streaming form: it can be written as flows complete, and it pipes into jq or a log shipper without the consumer holding the whole run in memory.

func WriteText

func WriteText(w io.Writer, r *Report) error

WriteText renders a human-readable summary.

Types

type Report

type Report struct {
	Tool        string                `json:"tool"`
	Version     string                `json:"version"`
	GeneratedAt time.Time             `json:"generated_at"`
	Sources     []string              `json:"sources"`
	Stats       assemble.Stats        `json:"stats"`
	Summary     inventory.Summary     `json:"summary"`
	Aggregates  []inventory.Aggregate `json:"aggregates,omitempty"`
	Records     []*inventory.Record   `json:"records,omitempty"`
}

Report is the complete output of one run.

Jump to

Keyboard shortcuts

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