Documentation
¶
Index ¶
- type Table
- func (t *Table) AddRow(values ...interface{})
- func (t *Table) AddRowList(rows ...[]string)
- func (t *Table) AddRowObject(obj interface{})
- func (t *Table) AddRowObjectList(objs interface{})
- func (t *Table) Print()
- func (t *Table) SetFormats(formats ...string)
- func (t *Table) SetHeaders(headers ...string)
- func (t *Table) SetHeadersFromStruct(obj interface{})
- func (t *Table) SetWidths(widths ...int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Table ¶
type Table struct {
Margin int
SplitLine bool
EmptyText string
FormatFunc func(header string, value interface{}) string
// contains filtered or unexported fields
}
func (*Table) AddRowList ¶
func (*Table) AddRowObject ¶ added in v1.1.0
func (t *Table) AddRowObject(obj interface{})
func (*Table) AddRowObjectList ¶ added in v1.1.0
func (t *Table) AddRowObjectList(objs interface{})
func (*Table) SetFormats ¶ added in v1.1.0
func (*Table) SetHeaders ¶
func (*Table) SetHeadersFromStruct ¶ added in v1.1.0
func (t *Table) SetHeadersFromStruct(obj interface{})
SetStructHeaders to add headers from struct tags
Example struct {
Name string `tableify:"-"` // header is fieldname: Name
Files int `tableify:"-"`
Age float64 `tableify:"-,0,%.2f"` // width is 0, format is "%.2f"
LastUpdated string `tableify:"Updated"` // header is "Updated"
Desc string // not as header
Click to show internal directories.
Click to hide internal directories.