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 ¶
const ( // DriverStdout defines the driver type // when outputting in stdout format. DriverStdout = "stdout" // 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.
Types ¶
This section is empty.