formatter

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOutputIndent = "  "

Variables

This section is empty.

Functions

func Format

func Format(outputFormat FormatName, outputIndent string, scheme scheme.Scheme, failedOnly bool) ([]byte, error)

func ValidateOutputFormat

func ValidateOutputFormat(outputFormat FormatName, schemeType scheme.SchemeType) error

Types

type FormatName

type FormatName = string
const (
	Human    FormatName = "human"
	Json     FormatName = "json"
	Sarif    FormatName = "sarif"
	Markdown FormatName = "markdown"
)

func OutputFormats

func OutputFormats() []FormatName

type HumanFormatter

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

func (*HumanFormatter) Format

func (f *HumanFormatter) Format(output scheme.Scheme, failedOnly bool) ([]byte, error)

func (*HumanFormatter) IsSchemeSupported

func (f *HumanFormatter) IsSchemeSupported(schemeType string) bool

type JsonFormatter

type JsonFormatter struct {
}

func (*JsonFormatter) Format

func (f *JsonFormatter) Format(s scheme.Scheme, failedOnly bool) ([]byte, error)

func (*JsonFormatter) IsSchemeSupported

func (f *JsonFormatter) IsSchemeSupported(schemeType string) bool

type NewFormatFunc

type NewFormatFunc func() OutputFormatter

type OutputFormatter

type OutputFormatter interface {
	Format(scheme scheme.Scheme, failedOnly bool) ([]byte, error)
	IsSchemeSupported(schemeType string) bool
}

func NewJsonFormatter

func NewJsonFormatter() OutputFormatter

type UnsupportedScheme

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

func (UnsupportedScheme) Error

func (e UnsupportedScheme) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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