table

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnDefinition

type ColumnDefinition struct {
	FieldNameFunc func(*PrintOpts) string
	FieldName     string
	TrimSize      int
}

type ColumnDefinitionFull

type ColumnDefinitionFull[T any] struct {
	FieldValueFunc func(T, *PrintOpts) string
	FieldNameFunc  func(*PrintOpts) string
	FieldName      string
	TrimSize       int
}

func (ColumnDefinitionFull[T]) ToColumnDefinition

func (tcd ColumnDefinitionFull[T]) ToColumnDefinition() ColumnDefinition

type PrintOpts

type PrintOpts struct {
	// Verbose indicates whether to print verbose output.
	Verbose bool

	// OmitFields indicates fields to omit.
	OmitFields []string
}

type Table

type Table struct {
	ColumnDefs []ColumnDefinition
	Rows       [][]string
}

func ColumnDefs2Table

func ColumnDefs2Table[T any](tcdwv []ColumnDefinitionFull[T], data []T, opts *PrintOpts) Table

Jump to

Keyboard shortcuts

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