format

package
v0.0.0-...-2b6c84e Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 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

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

GetPresenter retrieves a Presenter that matches a CLI option

Types

type Format

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

func Parse(userInput string) Format

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

func (Format) String

func (f Format) String() string

type PresentationConfig

type PresentationConfig struct {
	TemplateFilePath string
	ShowSuppressed   bool
}

type ScanResultWriter

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

func MakeScanResultWriter

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

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