table

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 27 Imported by: 7

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 added in v0.33.0

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 added in v0.60.0

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 added in v0.33.0

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

Types

type LicenseScanner added in v0.60.0

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

func (LicenseScanner) Alignment added in v0.60.0

func (s LicenseScanner) Alignment() table.Alignment

func (LicenseScanner) Count added in v0.60.0

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

func (LicenseScanner) Header added in v0.60.0

func (s LicenseScanner) Header() string

func (LicenseScanner) String added in v0.60.0

func (s LicenseScanner) String() string

type MisconfigScanner added in v0.60.0

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

func (MisconfigScanner) Alignment added in v0.60.0

func (s MisconfigScanner) Alignment() table.Alignment

func (MisconfigScanner) Count added in v0.60.0

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

func (MisconfigScanner) Header added in v0.60.0

func (s MisconfigScanner) Header() string

func (MisconfigScanner) String added in v0.60.0

func (s MisconfigScanner) String() string

type Options added in v0.60.0

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 added in v0.60.0

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 added in v0.60.0

func NewScanner(scanner types.Scanner) Scanner

type SecretScanner added in v0.60.0

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

func (SecretScanner) Alignment added in v0.60.0

func (s SecretScanner) Alignment() table.Alignment

func (SecretScanner) Count added in v0.60.0

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

func (SecretScanner) Header added in v0.60.0

func (s SecretScanner) Header() string

func (SecretScanner) String added in v0.60.0

func (s SecretScanner) String() string

type VulnerabilityScanner added in v0.60.0

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

func (VulnerabilityScanner) Alignment added in v0.60.0

func (s VulnerabilityScanner) Alignment() table.Alignment

func (VulnerabilityScanner) Count added in v0.60.0

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

func (VulnerabilityScanner) Header added in v0.60.0

func (s VulnerabilityScanner) Header() string

func (VulnerabilityScanner) String added in v0.60.0

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 added in v0.60.0

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
JackTT - Gopher 🇻🇳