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
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)
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
Click to show internal directories.
Click to hide internal directories.