output

package
v0.83.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFormat = FormatJSON
View Source
const DefaultPretty = true
View Source
const DefaultTerminalWidth = 80

Variables

This section is empty.

Functions

func FormatOptions

func FormatOptions() string

func JSON

func JSON(data interface{})

JSON allows you to override the default output method and explicitly print JSON to the screen

func Print

func Print(data interface{}) (err error)

Print outputs the data in the expected format

func PrintResultTable added in v0.71.0

func PrintResultTable(tableData [][]string)

PrintResultTable prints the New Relic Synthetic Atuomated tests in a tabular format by default

func Printf added in v0.8.11

func Printf(format string, a ...interface{})

Printf renders output based on the format and data provided

func SetFormat

func SetFormat(format Format) (err error)

func SetPrettyPrint

func SetPrettyPrint(pretty bool) (err error)

func Text added in v0.8.11

func Text(data interface{})

Text allows you to override the default output method and explicitly print text to the screen

func YAML added in v0.8.11

func YAML(data interface{})

YAML allows you to override the default output method and explicitly print YAML to the screen

Types

type ConfigOption

type ConfigOption func(*Output) error

func ConfigFormat

func ConfigFormat(format Format) ConfigOption

func ConfigPrettyPrint

func ConfigPrettyPrint(pretty bool) ConfigOption

type Format

type Format uint

Format provides the list of output formats supported

const (
	FormatJSON Format = iota
	FormatText
	FormatYAML
)

func ParseFormat

func ParseFormat(name string) Format

func (Format) String

func (f Format) String() string

String returns the string value of the format name

type Output

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

Output is the main ref for the output package

func New

func New(opts ...ConfigOption) (*Output, error)

New creates a new outputter with the specific config options

Jump to

Keyboard shortcuts

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