Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Columns ¶
Columns - maps short names of columns to their structure defining:
full name, length and whether it's right justified
For Example:
"env": Column{Name: "Environment", Length: 14},
"cls": Column{Name: "Cluster", Length: 40},
"srv": Column{Name: "Service", Length: 35},
"hst": Column{Name: "Host", Length: 45},
"pct": Column{Name: "%CPU", Length: 7, RightJustified: true},
func (Columns) Parse ¶
Parse - builds a Table out of a given list of columns
To simply print the table's title call Print() instead ¶
Parse() is usefull when you need to control where to output the title, for example to a log or a trace file
func (Columns) Print ¶
Print - does the following:
1) prints a table style heading for a given list of columns.
For example if Columns are defined as:
"env": Column{Name: "Environment", Length: 14},
"cls": Column{Name: "Cluster", Length: 40},
"srv": Column{Name: "Service", Length: 35},
It'll produce:
Environment Cluster Service
-------------- ---------------------------------------- -----------------------------------
Returns an fmt style format specifier string that you can use to output values under the above heading via Printf(format,...):
%-14v %-40v %-35v
Click to show internal directories.
Click to hide internal directories.