output

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterListPrint

func ClusterListPrint(cmd *cobra.Command, jsonObj []byte) error

func ClusterSelectPrint

func ClusterSelectPrint(cmd *cobra.Command, jsonObj []byte, clusterName string) error

func Exit

func Exit()

This function exits the pctl program. In case 'exit' is not set, nothing will be printed to the console. The return code of program is set to zero.

When 'exit' is set, the exit message will be printed to the console before the program exits with the return code set in the 'exit' structure.

func GetCount

func GetCount(obj interface{}) int

func LocationListPrint

func LocationListPrint(cmd *cobra.Command, jsonObj []byte) error

func PrintJson

func PrintJson(obj interface{}, pretty bool)

func PrintJsonObject

func PrintJsonObject(jsonObj []byte) error

func PrintList

func PrintList(cmd *cobra.Command, jsonObj []byte, fp func(obj interface{}) *OutputListSpec) error

func PrintObject

func PrintObject(cmd *cobra.Command, jsonObj []byte, fp func(obj interface{}) string) error

func PrintOutputer

func PrintOutputer(cmd *cobra.Command, obj Outputer)

func PrintRow

func PrintRow(spec *OutputListSpec, obj interface{}, row int, w *tabwriter.Writer)

func PrintRows

func PrintRows(spec *OutputListSpec, obj interface{})

func PrintSelectObject

func PrintSelectObject(cmd *cobra.Command, jsonObj []byte, sel string, fp func(obj interface{}, sel string) *OutputObjectSpec) error

func PrintYaml

func PrintYaml(obj interface{})

func PrintYamlObject

func PrintYamlObject(jsonObj []byte) error

Types

type ColumnSpec

type ColumnSpec struct {
	Header   string
	JsonPath string
}

type MatchSpec

type MatchSpec struct {
	JsonPath string
	Value    string // Value should match against the value stored in JsonPath
}

type OutputListSpec

type OutputListSpec struct {
	NRows   int
	Base    string
	Columns []ColumnSpec
}

func NewClusterListSpec

func NewClusterListSpec(obj interface{}) *OutputListSpec

func NewLocationListSpec

func NewLocationListSpec(obj interface{}) *OutputListSpec

type OutputObjectSpec

type OutputObjectSpec struct {
	NRows int
	Base  string
	Match MatchSpec
}

func NewClusterObjectSpec

func NewClusterObjectSpec(obj interface{}, clusterName string) *OutputObjectSpec

type Outputer

type Outputer interface {
	Output()
}

Jump to

Keyboard shortcuts

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