format

package
v0.86.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

AvailableFormats is a list of presenter format options available to users.

View Source
var DeprecatedFormats = []Format{
	EmbeddedVEXJSON,
	EmbeddedVEXXML,
}

DeprecatedFormats TODO: remove in v1.0

Functions

func GetPresenter added in v0.64.0

func GetPresenter(format Format, c PresentationConfig, pb models.PresenterConfig) presenter.Presenter

GetPresenter retrieves a Presenter that matches a CLI option

Types

type Format added in v0.64.0

type Format string

Format is a dedicated type to represent a specific kind of presenter output format.

const (
	UnknownFormat   Format = "unknown"
	JSONFormat      Format = "json"
	TableFormat     Format = "table"
	CycloneDXFormat Format = "cyclonedx"
	CycloneDXJSON   Format = "cyclonedx-json"
	CycloneDXXML    Format = "cyclonedx-xml"
	SarifFormat     Format = "sarif"
	TemplateFormat  Format = "template"

	// DEPRECATED <-- TODO: remove in v1.0
	EmbeddedVEXJSON Format = "embedded-cyclonedx-vex-json"
	EmbeddedVEXXML  Format = "embedded-cyclonedx-vex-xml"
)

func Parse added in v0.64.0

func Parse(userInput string) Format

Parse returns the presenter.format specified by the given user input.

func (Format) String added in v0.64.0

func (f Format) String() string

type PresentationConfig added in v0.64.0

type PresentationConfig struct {
	TemplateFilePath string
	ShowSuppressed   bool
}

type ScanResultWriter added in v0.64.0

type ScanResultWriter interface {
	Write(result models.PresenterConfig) error
}

func MakeScanResultWriter added in v0.64.0

func MakeScanResultWriter(outputs []string, defaultFile string, cfg PresentationConfig) (ScanResultWriter, error)

MakeScanResultWriter creates a ScanResultWriter for output or returns an error. this will either return a valid writer or an error but neither both and if there is no error, ScanResultWriter.Close() should be called

func MakeScanResultWriterForFormat added in v0.64.0

func MakeScanResultWriterForFormat(f string, path string, cfg PresentationConfig) (ScanResultWriter, error)

MakeScanResultWriterForFormat creates a ScanResultWriter for the given format or returns an error.

Jump to

Keyboard shortcuts

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