display

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package display contains helpers for formatting FlightCTL resources into different CLI output formats.

Index

Constants

View Source
const NoneString = "<none>"

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatOptions

type FormatOptions struct {
	Kind        string
	Name        string
	Summary     bool
	SummaryOnly bool
	Wide        bool
	Writer      io.Writer
}

FormatOptions contains options for formatting output

type JSONFormatter

type JSONFormatter struct{}

JSONFormatter handles JSON output formatting

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(data interface{}, options FormatOptions) error

Format outputs the data in JSON format

type NameFormatter

type NameFormatter struct{}

NameFormatter handles name-only output formatting

func (*NameFormatter) Format

func (f *NameFormatter) Format(data interface{}, options FormatOptions) error

Format outputs only the names of resources

type OutputFormat

type OutputFormat string

OutputFormat represents the different output formats supported

const (
	JSONFormat OutputFormat = "json"
	YAMLFormat OutputFormat = "yaml"
	NameFormat OutputFormat = "name"
	WideFormat OutputFormat = "wide"
)

type OutputFormatter

type OutputFormatter interface {
	Format(data interface{}, options FormatOptions) error
}

OutputFormatter defines the interface for formatting and displaying data

func NewFormatter

func NewFormatter(format OutputFormat) OutputFormatter

NewFormatter creates a new formatter based on the output format

type TableFormatter

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

TableFormatter handles table output formatting

func (*TableFormatter) Format

func (f *TableFormatter) Format(data interface{}, options FormatOptions) error

Format outputs the data in table format

type YAMLFormatter

type YAMLFormatter struct{}

YAMLFormatter handles YAML output formatting

func (*YAMLFormatter) Format

func (f *YAMLFormatter) Format(data interface{}, options FormatOptions) error

Format outputs the data in YAML format

Jump to

Keyboard shortcuts

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