format

package
v0.0.0-...-4cf0a74 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayColorSchemes

func DisplayColorSchemes()

DisplayColorSchemes outputs a quick preview of the configured color scheme to stdout.

func Print

func Print[T PrintDocument](formatter *Formatter, document T) error

Print renders the given document using the configured formatter

func RenderMatchShort

func RenderMatchShort(match *grype.Match) string

RenderMatchShort Renders a match as a single line of colored text

Types

type Formatter

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

Formatter can be used to format grype reports for output use NewFormatter to configure a new formatter.

func NewFormatter

func NewFormatter(format string, writer io.Writer) *Formatter

NewFormatter configures a new formatter for handling grype documents

func (*Formatter) PrintDiff

func (f *Formatter) PrintDiff(diff *grype.DocumentDiff) error

PrintDiff renders the given diff using the configured formatter

type PrintDocument

type PrintDocument interface {
	*grype.Document | *syft.Document
}

PrintDocument is a union type for grype and syft documents

Jump to

Keyboard shortcuts

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