Documentation ¶
Index ¶
- func Flatten(thing map[string]interface{}) (map[string]string, error)
- func FormatAsTable(entries []string, header string) (string, error)
- func Ticker(runner func(), done chan bool, interval time.Duration)
- func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool
- func WriteSorted(entries []string, writer io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flatten ¶
Flatten takes a structure and turns into a flat map[string]string.
Within the "thing" parameter, only primitive values are allowed. Structs are not supported. Therefore, it can only be slices, maps, primitives, and any combination of those together.
See the tests for examples of what inputs are turned into.
func FormatAsTable ¶
FormatAsTable formats the given string entries as table where the header string defines the column titles.
func Ticker ¶
Ticker always executes the runner function after the interval has expired. Every message on the done channel will stop the execution. Please note that this function will block until it receives the done message.
func WaitTimeout ¶
WaitTimeout waits for the waitgroup for the specified max timeout. Returns true if waiting timed out.
Types ¶
This section is empty.