cli

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

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