table

package
v0.0.0-...-b5b5a37 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SeverityColor = []func(a ...any) string{
		color.New(color.FgCyan).SprintFunc(),
		color.New(color.FgBlue).SprintFunc(),
		color.New(color.FgYellow).SprintFunc(),
		color.New(color.FgHiRed).SprintFunc(),
		color.New(color.FgRed).SprintFunc(),
	}
)

Functions

func ColorizeSeverity

func ColorizeSeverity(value, severity string) string

func IsOutputToTerminal

func IsOutputToTerminal(output io.Writer) bool

func NewFileLicenseRenderer

func NewFileLicenseRenderer(buf *bytes.Buffer, isTerminal bool, severities []dbTypes.Severity) *fileLicenseRenderer

func NewMisconfigRenderer

func NewMisconfigRenderer(buf *bytes.Buffer, severities []dbTypes.Severity, trace, includeNonFailures, ansi bool, renderCause []ftypes.ConfigType) *misconfigRenderer

func NewPkgLicenseRenderer

func NewPkgLicenseRenderer(buf *bytes.Buffer, isTerminal bool, severities []dbTypes.Severity) *pkgLicenseRenderer

func NewSecretRenderer

func NewSecretRenderer(buf *bytes.Buffer, ansi bool, severities []dbTypes.Severity) *secretRenderer

func NewSummaryRenderer

func NewSummaryRenderer(buf *bytes.Buffer, isTerminal bool, scanners types.Scanners) *summaryRenderer

func NewVulnerabilityRenderer

func NewVulnerabilityRenderer(buf *bytes.Buffer, isTerminal, tree, suppressed bool, severities []dbTypes.Severity) *vulnerabilityRenderer

func RenderTarget

func RenderTarget(w io.Writer, target string, isTerminal bool)

Types

type LicenseScanner

type LicenseScanner struct {
	// contains filtered or unexported fields
}

func (LicenseScanner) Alignment

func (s LicenseScanner) Alignment() table.Alignment

func (LicenseScanner) Count

func (s LicenseScanner) Count(result types.Result) int

func (LicenseScanner) Header

func (s LicenseScanner) Header() string

func (LicenseScanner) String

func (s LicenseScanner) String() string

type MisconfigScanner

type MisconfigScanner struct {
	// contains filtered or unexported fields
}

func (MisconfigScanner) Alignment

func (s MisconfigScanner) Alignment() table.Alignment

func (MisconfigScanner) Count

func (s MisconfigScanner) Count(result types.Result) int

func (MisconfigScanner) Header

func (s MisconfigScanner) Header() string

func (MisconfigScanner) String

func (s MisconfigScanner) String() string

type Options

type Options struct {
	Scanners   types.Scanners
	Severities []dbTypes.Severity
	Output     io.Writer

	// Show dependency origin tree
	Tree bool

	// Show suppressed findings
	ShowSuppressed bool

	// Show/hide summary/detailed tables
	TableModes []types.TableMode

	// For misconfigurations
	IncludeNonFailures bool
	Trace              bool
	RenderCause        []ftypes.ConfigType

	// For licenses
	LicenseRiskThreshold int
	IgnoredLicenses      []string
}

type Renderer

type Renderer interface {
	Render(result types.Result)
}

type Scanner

type Scanner interface {
	Header() string
	Alignment() table.Alignment

	// Count returns the number of findings, but -1 if the scanner is not applicable
	Count(result types.Result) int

	String() string // Required to show correct logs
}

func NewScanner

func NewScanner(scanner types.Scanner) Scanner

type SecretScanner

type SecretScanner struct {
	// contains filtered or unexported fields
}

func (SecretScanner) Alignment

func (s SecretScanner) Alignment() table.Alignment

func (SecretScanner) Count

func (s SecretScanner) Count(result types.Result) int

func (SecretScanner) Header

func (s SecretScanner) Header() string

func (SecretScanner) String

func (s SecretScanner) String() string

type VulnerabilityScanner

type VulnerabilityScanner struct {
	// contains filtered or unexported fields
}

func (VulnerabilityScanner) Alignment

func (s VulnerabilityScanner) Alignment() table.Alignment

func (VulnerabilityScanner) Count

func (s VulnerabilityScanner) Count(result types.Result) int

func (VulnerabilityScanner) Header

func (s VulnerabilityScanner) Header() string

func (VulnerabilityScanner) String

func (s VulnerabilityScanner) String() string

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer implements Writer and output in tabular form

func NewWriter

func NewWriter(options Options) *Writer

func (*Writer) Write

func (tw *Writer) Write(_ context.Context, report types.Report) error

Write writes the result on standard output

Jump to

Keyboard shortcuts

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