report

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package report renders scan results for terminals and machines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w io.Writer, results []scan.Result, o Options) error

JSON writes results as one JSON document. Credential values are redacted unless ShowSecrets is set.

func Plural added in v0.2.0

func Plural(n int, one, many string) string

Plural picks the singular or plural form for n.

func Refs

func Refs(refs []string, limit int) string

Refs renders ref names compactly: branches by name (default branches first), tags as "tag v1", pull request refs as "PR #12", at most limit entries; limit 0 means all of them.

func StatusLine

func StatusLine(r scan.Result, o Options) string

StatusLine renders the one-line outcome for a target as it completes.

func Text

func Text(w io.Writer, results []scan.Result, o Options)

Text writes the final report: every distinct credential with all the places it was found, followed by a summary line.

Types

type Options

type Options struct {
	Color       bool
	ShowSecrets bool
	// AllRefs lists every ref a commit is on instead of the first few.
	AllRefs bool
	// Providers answers where a credential of each kind is revoked. It is
	// required for Text: the caller assembles it, so this package need not
	// know any provider. A nil registry is a programming error and panics.
	Providers *detect.Registry
}

Options control text rendering.

type Output

type Output struct {
	Summary summary       `json:"summary"`
	Results []scan.Result `json:"results"`
}

Output is the JSON document written by JSON.

type Step added in v0.2.0

type Step struct {
	Label string
	Text  string
}

Step is one line of advice under a finding.

func Remediation added in v0.2.0

func Remediation(f scan.Finding, registry *detect.Registry) []Step

Remediation says what to do about a credential: what it unlocks in the scanned repositories when its provider can tell, how to revoke it, where it is still configured on this machine, and what its history needs. A credential its provider already rejects needs nothing.

Jump to

Keyboard shortcuts

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