Documentation ¶
Index ¶
- Variables
- func FormatDuration(t time.Duration) string
- func FormatDurationPadded(t time.Duration) string
- func FormatUnitBytes(bytes int64) (s string)
- func GenerateColorBarLookupTable() (colorTable map[int8]string, barTable map[int8]string)
- func GetBarChar(pct int) string
- func GetColorPct(pct int) string
- func GetUnitBytes(bytes int64) (divider int, unit string)
- func IntOrZero(s string) int
- func Sub100(i int) int
- func WaitForTs(nextTs *time.Time)
- type Template
Constants ¶
This section is empty.
Variables ¶
View Source
var BlockChar = `█`
View Source
var HBarChar = []string{
` `,
`▏`,
`▎`,
`▍`,
`▌`,
`▋`,
`▊`,
`▉`,
`█`,
}
View Source
var VBarChar = []string{
` `,
`_`,
`▁`,
`▂`,
`▃`,
`▄`,
`▅`,
`▆`,
}
Functions ¶
func FormatDuration ¶
Formats duration. Does not go over 7 characters till 9999+h
func FormatDurationPadded ¶
FormatDuration with added padding to 7 (
func GetColorPct ¶
generate color from percentage (0 - good/green 100 - bad/red)
func GetUnitBytes ¶
calculate divider and unit for bytes
Types ¶
Click to show internal directories.
Click to hide internal directories.