cli

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 4 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

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTableStyle = errors.New("invalid table style")

Functions

func PrintValidationErrors

func PrintValidationErrors(errs []error)

PrintValidationErrors - helper to pretty print validationErrors

func Version

func Version() string

Types

type Field

type Field struct {
	Value string
	Color FieldColor
}

func (Field) ToCell

func (f Field) ToCell() *simpletable.Cell

type FieldColor

type FieldColor string
const (
	FieldColorGreen            FieldColor = "green"
	FieldColorRed              FieldColor = "red"
	FieldColorIntenselyBoldRed FieldColor = "intenselyBoldRed"
)

func (FieldColor) Apply

func (fc FieldColor) Apply(s string) string

type Table

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

func NewTable

func NewTable(opts ...TableOption) (*Table, error)

func (*Table) String

func (t *Table) String() string

func (*Table) WriteRow

func (t *Table) WriteRow(row TableRow)

type TableConfig

type TableConfig struct {
	Header *simpletable.Header
	Style  *simpletable.Style
}

func (*TableConfig) Default

func (c *TableConfig) Default()

func (*TableConfig) Option

func (c *TableConfig) Option(opts ...TableOption) error

type TableHeader

type TableHeader []string

func (TableHeader) ToSimpleTableHeader

func (th TableHeader) ToSimpleTableHeader() *simpletable.Header

type TableOption

type TableOption interface {
	ConfigureTable(*TableConfig) error
}

type TableRow

type TableRow []Field

func (TableRow) ToCells

func (r TableRow) ToCells() []*simpletable.Cell

type TableStyle

type TableStyle string
const (
	TableStyleCompactLite TableStyle = "compactLite"
)

func (TableStyle) ToSimpleTableStyle

func (ts TableStyle) ToSimpleTableStyle() (*simpletable.Style, error)

type WithHeaders

type WithHeaders TableHeader

func (WithHeaders) ConfigureTable

func (h WithHeaders) ConfigureTable(c *TableConfig) error

type WithStyle

type WithStyle TableStyle

func (WithStyle) ConfigureTable

func (s WithStyle) ConfigureTable(c *TableConfig) error

Jump to

Keyboard shortcuts

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