display

package
v1.1.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	WithExports 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