printer

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatText = "text"
	FormatJSON = "json"
	FormatHTML = "html"
	FormatSVG  = "svg"
)

Variables

View Source
var ErrTemplateInvalid = errors.New("template invalid")

SupportedFormats lists every format accepted by the printer package, in the canonical order used by help text and test matrices.

Functions

func HTML added in v1.0.4

func HTML(r *result.Result, writer io.Writer) error

func IsSupportedFormat added in v1.12.5

func IsSupportedFormat(name string) bool

IsSupportedFormat reports whether name is one of SupportedFormats.

func JSON added in v1.0.4

func JSON(r any, writer io.Writer, options *JSONOption) error

func Svg added in v0.3.0

func Svg(r *result.Result, writer io.Writer, options *SvgOption) error

func Text

func Text(r *result.Result, writer io.Writer, options *CommonOption) error

Types

type CommonOption added in v0.3.0

type CommonOption struct {
	HideSections bool
	HideMain     bool
	HideStd      bool
}

type JSONOption added in v1.0.4

type JSONOption struct {
	Indent     *int
	HideDetail bool
}

type SvgOption added in v0.3.0

type SvgOption struct {
	CommonOption
	Width       int
	Height      int
	MarginBox   int
	PaddingBox  int
	PaddingRoot int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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