Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHeaderString ¶
GetHeaderString extract the set of column names from a template.
func TrimAndPad ¶
TrimAndPad modifies `s` so that it is exactly `l` characters long, removing characters from the end, or adding spaces as necessary.
Types ¶
type Format ¶
type Format string
Format defines a type for a string that can be used as template to format data.
func (Format) ExecuteFixedWidth ¶
func (f Format) ExecuteFixedWidth(columnWidths interface{}, header bool, data interface{}) (string, error)
ExecuteFixedWidth Formats a table row using a set of fixed column widths. Used for streaming output where column widths cannot be automatically determined because only one line of the output is available at a time.
Assumes the format uses tab as a field delimiter.
columnWidths: struct that contains column widths header: If true return the header. If false then evaluate data and return data. data: Data to evaluate