Documentation
¶
Index ¶
- func F(v any) string
- func HumanizeDuration(d time.Duration) string
- type Writer
- func (w *Writer) AddMapInts(data map[string]int, sortValues bool, reverse bool)
- func (w *Writer) AddMapIntsAsValue(t string, data map[string]int, sortValues bool, reverse bool)
- func (w *Writer) AddMapStrings(data map[string]string)
- func (w *Writer) AddMapStringsAsValue(t string, data map[string]string)
- func (w *Writer) AddRow(t string, v any)
- func (w *Writer) AddRowIf(t string, v any, condition bool)
- func (w *Writer) AddRowIfNotEmpty(t string, v string)
- func (w *Writer) AddRowf(t string, format string, a ...any)
- func (w *Writer) AddSectionTitle(format string, a ...any)
- func (w *Writer) AddStringsAsValue(t string, data []string)
- func (w *Writer) Frender(o io.Writer) error
- func (w *Writer) Indent(width int)
- func (w *Writer) Println(msg ...string)
- func (w *Writer) Render() (string, error)
- func (w *Writer) SetColorScheme(s string)
- func (w *Writer) SetHeading(format string, a ...any)
- func (w *Writer) SetSeparator(seq string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HumanizeDuration ¶
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) AddMapInts ¶
AddMapInts adds data with each key being a column title and value what follows the :. Optionally sorts by value
func (*Writer) AddMapIntsAsValue ¶
AddMapIntsAsValue adds a row with title t and the data as value. Optionally sorts by value.
func (*Writer) AddMapStrings ¶
AddMapStrings adds data with each key being a column title and value what follows the :
func (*Writer) AddMapStringsAsValue ¶
AddMapStringsAsValue adds a row with title t and the data as value, over multiple lines and correctly justified
func (*Writer) AddRow ¶
AddRow adds a row, v will be formatted if time.Time, time.Duration, []string, floats, ints and uints
func (*Writer) AddRowIfNotEmpty ¶
AddRowIfNotEmpty adds a row if v is not an empty string
func (*Writer) AddRowf ¶
AddRowf adds a row with printf like behavior on the value, no auto formatting of values will be done like in AddRow()
func (*Writer) AddSectionTitle ¶
AddSectionTitle adds a new section
func (*Writer) AddStringsAsValue ¶ added in v0.1.5
AddStringsAsValue adds multiple data items on the right under one heading on the left
func (*Writer) Indent ¶
Indent results in all following text to be indented this many spaces. When called it sets that value, zero resets to no indent
func (*Writer) SetColorScheme ¶
SetColorScheme sets a color schema to use. One of yellow, blue, cyan, green, magenta or red - rest treated as no color
func (*Writer) SetHeading ¶
SetHeading sets the initial heading
func (*Writer) SetSeparator ¶
SetSeparator sets the separator to use after headings, defaults to :