output

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package output provides the ability for Vela to manage and manipulate the output rendered for a CLI action.

Usage:

import "github.com/go-vela/cli/internal/output"

Index

Constants

View Source
const (
	// DriverStdout defines the driver type
	// when outputting in stdout format.
	DriverStdout = "stdout"

	// DriverStderr defines the driver type
	// when outputting in stderr format.
	DriverStderr = "stderr"

	// DriverDump defines the driver type
	// when outputting in dump format.
	DriverDump = "dump"

	// DriverJSON defines the driver type
	// when outputting in JSON format.
	DriverJSON = "json"

	// DriverRawJSON defines the driver type
	// when outputting in raw JSON format.
	DriverRawJSON = "rawjson"

	// DriverSpew defines the driver type
	// when outputting in github.com/davecgh/go-spew/spew format.
	DriverSpew = "spew"

	// DriverYAML defines the driver type
	// when outputting in YAML format.
	DriverYAML = "yaml"
)

output drivers.

Variables

This section is empty.

Functions

func Dump

func Dump(_input interface{}) error

Dump outputs the provided input to stdout using github.com/davecgh/go-spew/spew to dump the input.

More Information:

Dump displays the passed parameters to standard out with newlines, customizable indentation, and additional debug information such as complete types and all pointer addresses used to indirect to the final value. It provides the following features over the built-in printing facilities provided by the fmt package:

  • Pointers are dereferenced and followed
  • Circular data structures are detected and handled properly
  • Custom Stringer/error interfaces are optionally invoked, including on unexported types
  • Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables
  • Byte arrays and slices are dumped like the hexdump -C command which includes offsets, byte values in hex, and ASCII output

func JSON

func JSON(_input interface{}) error

JSON parses the provided input and renders the parsed input in pretty JSON before outputting it to stdout.

func RawJSON

func RawJSON(_input interface{}) error

RawJSON parses the provided input and renders the parsed input in raw JSON before outputting it to stdout.

func Spew

func Spew(_input interface{}) error

Spew outputs the provided input to stdout using github.com/davecgh/go-spew/spew to verbosely print the input.

func Stderr added in v0.19.0

func Stderr(_input interface{}) error

Stderr outputs the provided input to stderr.

func Stdout

func Stdout(_input interface{}) error

Stdout outputs the provided input to stdout.

func YAML

func YAML(_input interface{}) error

YAML parses the provided input and renders the parsed input in YAML before outputting it to stdout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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