display

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCurrentLine

func ClearCurrentLine()

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 DisplayErrorTiming added in v0.16.2

func DisplayErrorTiming(t time.Time)

DisplayErrorTiming shows the time taken for the query to fail

func GetMaxCols added in v0.21.0

func GetMaxCols() int

func NewDisplayConfiguration added in v0.20.0

func NewDisplayConfiguration() *displayConfiguration

NewDisplayConfiguration creates a default configuration with timing set to true if both --timing is true and --output is table

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 PrintInstallReports

func PrintInstallReports(reports PluginInstallReports, isUpdateReport bool)

PrintInstallReports Prints out the installation reports onto the console

func ShowOutput

func ShowOutput(ctx context.Context, result *queryresult.Result, opts ...DisplayOption) int

ShowOutput displays the output using the proper formatter as applicable

func ShowPaged

func ShowPaged(ctx context.Context, content string)

ShowPaged displays the `content` in a system dependent pager

func ShowVarsListJson

func ShowVarsListJson(vars []*modconfig.Variable)

func ShowVarsListTable

func ShowVarsListTable(vars []*modconfig.Variable)

func ShowWrappedTable

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

Types

type ColumnValueOption added in v0.19.0

type ColumnValueOption func(opt *columnValueSettings)

func WithNullString added in v0.19.0

func WithNullString(nullString string) ColumnValueOption

type DisplayOption added in v0.19.0

type DisplayOption = func(config *displayConfiguration)

func WithTimingDisabled added in v0.20.0

func WithTimingDisabled() DisplayOption

WithTimingDisabled forcefully disables display of timing data

type PluginInstallReport

type PluginInstallReport struct {
	Skipped        bool
	Plugin         string
	SkipReason     string
	DocURL         string
	Version        string
	IsUpdateReport bool
}

func (*PluginInstallReport) String

func (i *PluginInstallReport) String() string

type PluginInstallReports

type PluginInstallReports []*PluginInstallReport

func (PluginInstallReports) Len

func (i PluginInstallReports) Len() int

making the type compatible with sort.Interface so that we can use the sort package utilities

func (PluginInstallReports) Less

func (i PluginInstallReports) Less(lIdx, rIdx int) bool

func (PluginInstallReports) Swap

func (i PluginInstallReports) Swap(lIdx, rIdx int)

type ShowWrappedTableOptions added in v0.17.0

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