Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Names []string
View Source
var Outputs = []Output{ Yaml, Table, }
View Source
var Table = &table{}
View Source
var Yaml = &yaml{}
Functions ¶
func MarshalYaml ¶
Types ¶
type Output ¶
type Output interface {
// GetName returns the name of the output format, will be used by the CLI to identify the output format.
GetName() string
// AsTable true if the kubernetes request should be made with the `application/json;as=Table;v=0.1` header.
AsTable() bool
// PrintObj prints the given object as a string.
PrintObj(obj runtime.Unstructured) (string, error)
// PrintObjStructured prints the given object and also extracts structured data.
PrintObjStructured(obj runtime.Unstructured) (*PrintResult, error)
}
func FromString ¶
type PrintResult ¶ added in v0.0.60
type PrintResult struct {
// Text is the human-readable formatted output (YAML or Table).
Text string
// Structured is an optional JSON-serializable value extracted from the object.
// For Table output, this is []map[string]any with column headers as keys.
// For YAML output, this is the cleaned-up object items as []map[string]any (lists)
// or a single map[string]any (individual objects).
Structured any
}
PrintResult holds both the text representation and optional structured data extracted from a Kubernetes object.
Click to show internal directories.
Click to hide internal directories.