Documentation
¶
Index ¶
- func NewAuditProgress(o Options, verbose bool) (*audit.Progress, func())
- func RenderAudit(o Options, version string, result *audit.Result) error
- func RenderChecks(o Options, version string, results []check.Result) error
- func RenderFeed(o Options, version string, result *feed.Result) error
- func RenderFeedWithDashboard(o Options, version string, result *feed.Result) error
- func RenderIDs(o Options, version string, vulns []*malindex.Vulnerability) error
- func RenderSearch(o Options, version string, result *search.Result) error
- func ResolveExportPath(outputFlag string, format ExportFormat, formats []ExportFormat) (string, error)
- func WriteAuditCSV(path string, result *audit.Result) error
- func WriteAuditExport(path string, format ExportFormat, version, command string, ...) (string, error)
- func WriteAuditTextFile(path string, result *audit.Result) error
- func WriteErrorJSON(w io.Writer, version string, code int, message string) error
- func WriteJSON(w io.Writer, version, command string, data interface{}) error
- func WriteResultFile(path, version, command string, data interface{}) (string, error)
- func WriteSARIF(path, toolVersion string, result *audit.Result) (string, error)
- type Envelope
- type ExportFormat
- type Options
- type Spinner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuditProgress ¶
NewAuditProgress builds the audit progress reporter and a stop function. The stop function halts the background activity animator and clears the transient line; callers must invoke it before rendering final results to stdout.
func RenderFeedWithDashboard ¶
func ResolveExportPath ¶
func ResolveExportPath(outputFlag string, format ExportFormat, formats []ExportFormat) (string, error)
ResolveExportPath maps --output and --output-format to a concrete file path. When outputFlag is empty a temp file is created.
func WriteAuditCSV ¶
WriteAuditCSV writes one row per finding to path. When there are no findings, a single summary row captures the audit verdict and scan stats.
func WriteAuditExport ¶
func WriteAuditExport(path string, format ExportFormat, version, command string, result *audit.Result) (string, error)
WriteAuditExport writes an audit result using the requested export format.
func WriteAuditTextFile ¶
WriteAuditTextFile writes the human audit render without ANSI colors to path.
func WriteErrorJSON ¶
func WriteResultFile ¶
WriteResultFile serializes the standard JSON envelope to path (creating parent directories) and returns the written path. It mirrors exactly what --json prints to stdout, so the file is a drop-in machine-readable copy.
func WriteSARIF ¶
WriteSARIF renders the audit findings as a SARIF 2.1.0 report at path (creating parent directories) and returns the written path. The report is consumable by GitHub code scanning and other SARIF-aware tools.
Types ¶
type ExportFormat ¶
type ExportFormat string
ExportFormat is a file export encoding for audit/github results.
const ( ExportJSON ExportFormat = "json" ExportCSV ExportFormat = "csv" ExportTXT ExportFormat = "txt" )
func ParseExportFormats ¶
func ParseExportFormats(raw string) ([]ExportFormat, error)
ParseExportFormats parses a comma-separated export format list. An empty string defaults to json.
func (ExportFormat) ExportNoticeLabel ¶
func (f ExportFormat) ExportNoticeLabel() string
ExportNoticeLabel is the human label used in terminal path notices.
type Options ¶
func NewOptions ¶
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner is an indeterminate activity indicator for blocking work (network or API calls) that has no granular progress to report. It animates on stderr only for interactive terminals, so it never pollutes piped output, JSON, or CI logs. A nil or disabled Spinner is safe to Start/Stop.
func NewSpinner ¶
NewSpinner returns a spinner bound to o.ErrOut. It is automatically disabled (turned into a no-op) for JSON output and non-interactive writers, so callers can wrap any blocking call unconditionally.
func (*Spinner) SetMessage ¶
SetMessage updates the spinner label while it is running.