output

package
v0.40.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package output provides writers in different formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteOutputArg

func CompleteOutputArg(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

CompleteOutputArg represents tab completion for `--output` argument.

Types

type JSON

type JSON struct {
	// contains filtered or unexported fields
}

JSON outputs resources in JSON format.

func NewJSON

func NewJSON(writer io.Writer) *JSON

NewJSON initializes JSON resource output.

func (*JSON) Flush

func (j *JSON) Flush() error

Flush implements output.Writer interface.

func (*JSON) WriteHeader

func (j *JSON) WriteHeader(_ *meta.ResourceDefinition, withEvents bool) error

WriteHeader implements output.Writer interface.

func (*JSON) WriteResource

func (j *JSON) WriteResource(r resource.Resource, event state.EventType) error

WriteResource implements output.Writer interface.

type JSONPath

type JSONPath struct {
	// contains filtered or unexported fields
}

JSONPath outputs resources in JSONPath format.

func NewJSONPath

func NewJSONPath(writer io.Writer, jsonPath *jsonpath.JSONPath) *JSONPath

NewJSONPath initializes JSONPath resource output.

func (*JSONPath) Flush

func (j *JSONPath) Flush() error

Flush implements output.Writer interface.

func (*JSONPath) WriteHeader

func (j *JSONPath) WriteHeader(definition *meta.ResourceDefinition, withEvents bool) error

WriteHeader implements output.Writer interface.

func (*JSONPath) WriteResource

func (j *JSONPath) WriteResource(r resource.Resource, event state.EventType) error

WriteResource implements output.Writer interface.

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table outputs resources in Table view.

func NewTable

func NewTable() *Table

NewTable initializes table resource output.

func (*Table) Flush

func (table *Table) Flush() error

Flush implements output.Writer interface.

func (*Table) WriteHeader

func (table *Table) WriteHeader(definition *meta.ResourceDefinition, withEvents bool) error

WriteHeader implements output.Writer interface.

func (*Table) WriteResource

func (table *Table) WriteResource(r resource.Resource, event state.EventType) error

WriteResource implements output.Writer interface.

type Writer

type Writer interface {
	WriteHeader(definition *meta.ResourceDefinition, withEvents bool) error
	WriteResource(r resource.Resource, event state.EventType) error
	Flush() error
}

Writer interface.

func NewWriter

func NewWriter(format string) (Writer, error)

NewWriter builds writer from type.

type YAML

type YAML struct {
	// contains filtered or unexported fields
}

YAML outputs resources in YAML format.

func NewYAML

func NewYAML() *YAML

NewYAML initializes YAML resource output.

func (*YAML) Flush

func (y *YAML) Flush() error

Flush implements output.Writer interface.

func (*YAML) WriteHeader

func (y *YAML) WriteHeader(_ *meta.ResourceDefinition, withEvents bool) error

WriteHeader implements output.Writer interface.

func (*YAML) WriteResource

func (y *YAML) WriteResource(r resource.Resource, event state.EventType) error

WriteResource implements output.Writer interface.

Jump to

Keyboard shortcuts

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