formatter

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 12 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 interface{}, failedOnly bool) ([]byte, error)

func ValidateOutputFormat

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

Types

type FormatName

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

func OutputFormats

func OutputFormats() []FormatName

type HumanFormatter

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

func (*HumanFormatter) Format

func (f *HumanFormatter) Format(output interface{}, failedOnly bool) ([]byte, error)

func (*HumanFormatter) IsSchemeSupported

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

type JsonFormatter

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

func (*JsonFormatter) Format

func (f *JsonFormatter) Format(scheme interface{}, failedOnly bool) ([]byte, error)

func (*JsonFormatter) IsSchemeSupported

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

type NewFormatFunc

type NewFormatFunc func(indent string) OutputFormatter

type OutputFormatter

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

func NewHumanFormatter

func NewHumanFormatter(indent string) OutputFormatter

func NewJsonFormatter

func NewJsonFormatter(indent string) 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