render

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(cmd *cobra.Command, obj interface{}, w io.Writer) error

func Obj

func Obj(cmd *cobra.Command, obj interface{}, w io.Writer, renderer ...CliObjRenderer) error

func RenderGoTemplate

func RenderGoTemplate(item interface{}, w io.Writer, tpl string) error

func RenderGoTemplateList

func RenderGoTemplateList(list []interface{}, w io.Writer, tpl string) error

func RenderJSON

func RenderJSON(obj interface{}, w io.Writer) error

func RenderPrettyList

func RenderPrettyList(obj ui.TableData, w io.Writer) error

func RenderYaml

func RenderYaml(obj interface{}, w io.Writer) error

Types

type CliObjRenderer

type CliObjRenderer func(ui *ui.UI, obj interface{}) error

type OutputType

type OutputType string
const (
	OutputGoTemplate OutputType = "go"
	OutputJSON       OutputType = "json"
	OutputYAML       OutputType = "yaml"
	OutputPretty     OutputType = "pretty"
)

Jump to

Keyboard shortcuts

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