display

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnNames

func ColumnNames(columns []*queryresult.ColumnDef) []string

ColumnNames :: extract names from columns

func ColumnValueAsString

func ColumnValueAsString(val interface{}, col *queryresult.ColumnDef, opts ...ColumnValueOption) (result string, err error)

ColumnValueAsString converts column value to string

func ColumnValuesAsString

func ColumnValuesAsString(values []interface{}, columns []*queryresult.ColumnDef, opts ...ColumnValueOption) ([]string, error)

ColumnValuesAsString converts a slice of columns into strings

func GetMaxCols

func GetMaxCols() int

func ListResources

func ListResources[T modconfig.ModTreeItem](cmd *cobra.Command)

func ParseJSONOutputColumnValue

func ParseJSONOutputColumnValue(val interface{}, col *queryresult.ColumnDef) (interface{}, error)

ParseJSONOutputColumnValue segregate data types, ignore string conversion for certain data types : JSON, JSONB, BOOL and so on..

func PrintTiming

func PrintTiming(timingMetadata *queryresult.TimingMetadata)

func ShowPaged

func ShowPaged(ctx context.Context, content string)

ShowPaged displays the `content` in a system dependent pager

func ShowQueryOutput

func ShowQueryOutput(ctx context.Context, result *queryresult.Result) int

ShowQueryOutput displays the output using the proper formatter as applicable

func ShowResource

func ShowResource[T modconfig.ModTreeItem](cmd *cobra.Command, args []string)

func ShowWrappedTable

func ShowWrappedTable(headers []string, rows [][]string, opts *ShowWrappedTableOptions)

Types

type ColumnValueOption

type ColumnValueOption func(opt *columnValueSettings)

func WithNullString

func WithNullString(nullString string) ColumnValueOption

type PrintableHclResource

type PrintableHclResource[T printers.Listable] struct {
	Items []T
}

func NewPrintableHclResource

func NewPrintableHclResource[T printers.Listable](items []T) *PrintableHclResource[T]

func (PrintableHclResource[T]) GetItems

func (p PrintableHclResource[T]) GetItems() []T

func (PrintableHclResource[T]) GetTable

func (p PrintableHclResource[T]) GetTable() (*printers.Table, error)

type ShowWrappedTableOptions

type ShowWrappedTableOptions struct {
	AutoMerge        bool
	HideEmptyColumns bool
	Truncate         bool
}

Jump to

Keyboard shortcuts

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