utils

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flatten

func Flatten(thing map[string]interface{}) (map[string]string, error)

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

func FormatAsTable(entries []string, header string) (string, error)

FormatAsTable formats the given string entries as table where the header string defines the column titles.

func Ticker

func Ticker(runner func(), done chan bool, interval time.Duration)

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

func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool

WaitTimeout waits for the waitgroup for the specified max timeout. Returns true if waiting timed out.

func WriteSorted

func WriteSorted(entries []string, writer io.Writer) error

WriteSorted writes all elements from entries sorted into the given writer.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL