Documentation
¶
Overview ¶
Package report renders an inventory as text, JSON or NDJSON.
Index ¶
- func FlowLine(r *inventory.Record) string
- func SortRecords(records []*inventory.Record)
- func WriteCBOM(w io.Writer, r *Report, records []*inventory.Record) error
- func WriteHTML(w io.Writer, r *Report, records []*inventory.Record) error
- func WriteJSON(w io.Writer, r *Report) error
- func WriteLiveHTML(w io.Writer, r *Report, records []*inventory.Record, refreshSeconds int) error
- func WriteNDJSON(w io.Writer, records []*inventory.Record) error
- func WriteText(w io.Writer, r *Report) error
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlowLine ¶
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 ¶
SortRecords orders records by severity then by time, so the most alarming handshake is the first thing a reader sees.
func WriteLiveHTML ¶
WriteLiveHTML renders the page with a refresh interval, for a capture still in progress.
func WriteNDJSON ¶
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.
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.
Click to show internal directories.
Click to hide internal directories.