output

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedFormat = errors.New("unsupported output")

ErrUnsupportedOutputFormat is returned when an output is requested by string that this package doesn't implement.

Formats are the supported output formats

Functions

This section is empty.

Types

type Format

type Format string

Format is a supported output format

const (
	// FormatShort prints the repositories and their scores.
	FormatShort Format = "short"

	// FormatWide prints the package version information, as well as
	// the repositories and their scores.
	FormatWide Format = "wide"

	// FormatJSON prints the report as a JSON document
	FormatJSON Format = "json"
)

type Option

type Option func(*output)

Option is a functional option that configures the output behaviour

func WithAll

func WithAll(all bool) Option

WithAll is a functional option that configures outputs to return all packages, even if they don't have a scorecard score

type Output

type Output interface {
	WriteReport(io.Writer, types.Report) error
}

Output writes output for tally

func NewOutput

func NewOutput(format Format, opts ...Option) (Output, error)

NewOutput returns a new output, configured by the provided options

Jump to

Keyboard shortcuts

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