table

package
v0.35.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const WriterFormat writer.Format = "table"

WriterFormat is the format of this writer.

Variables

This section is empty.

Functions

func NewTabWriter

func NewTabWriter(output io.Writer) *tabwriter.Writer

NewTabWriter returns a tabwriter that translates tabbed columns in input into properly aligned text.

Types

type Column

type Column struct {
	// Name is a human readable name for the column.
	Name string `json:"name"`

	// Priority is an integer defining the relative importance of this column
	// compared to others. Lower numbers are considered higher priority.
	Priority int32 `json:"priority"`
}

Column represents an individual column in a table.

type Row

type Row struct {
	// Cells will be as wide as the column definitions array and may contain
	// strings, numbers, booleans, simple maps, lists, or null.
	Cells []interface{} `json:"cells"`
	// contains filtered or unexported fields
}

Row represents an individual row in a table.

type Table

type Table struct {
	// Columns represents a collection of column names (i.e. header line).
	Columns []Column `json:"columns"`

	// Rows represents a collection of resources.
	Rows []Row `json:"rows"`
}

Table is a tabular representation of a set of resources.

type Writer

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

func (*Writer) Write

func (x *Writer) Write(obj interface{}) error

Jump to

Keyboard shortcuts

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