Documentation
¶
Overview ¶
Package report renders scan results as text for terminals, Markdown for tickets and pull requests, and JSON for tools. Reports only ever contain names, counts and categories: never sampled values.
Index ¶
- Constants
- func Count(n int64) string
- func JSON(w io.Writer, res *model.Result) error
- func LeakJSON(w io.Writer, res *model.LeakResult) error
- func LeakLimits(n int) []string
- func LeakLine(c model.LeakColumn) string
- func LeakText(w io.Writer, res *model.LeakResult, colors bool) error
- func Markdown(w io.Writer, res *model.Result) error
- func Text(w io.Writer, res *model.Result, opts TextOptions) error
- type TextOptions
Constants ¶
const Headline = "What a plain copy of this database would carry into staging"
Headline is the question every report answers first.
const LeakHeadline = "Sampled production values found on this staging database"
LeakHeadline is the question a leak check's report answers first. It says "sampled" and "found" so that a zero under it can't read as "none".
Variables ¶
This section is empty.
Functions ¶
func LeakJSON ¶ added in v0.12.0
func LeakJSON(w io.Writer, res *model.LeakResult) error
LeakJSON writes a leak check's result as indented JSON.
func LeakLimits ¶ added in v0.12.0
LeakLimits is the "How to read this" list. Every report carries it, JSON included, with n, the sample's size, in the odds.
func LeakLine ¶ added in v0.12.0
func LeakLine(c model.LeakColumn) string
LeakLine is the report's line about a column, from its numbers.
func LeakText ¶ added in v0.12.0
LeakText writes a leak check's terminal report. It says clearly what it can't know, since the worst it could do is read as "staging is fine".
Types ¶
type TextOptions ¶
type TextOptions struct {
Color bool // use ANSI colours
Verbose bool // also list low-confidence matches, relationships and full evidence
ConfigWritten bool // a starter config was written. Its path isn't printed: it may be a secret typed in the wrong place
}
TextOptions control the terminal report.