util

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Average

func Average(data []float64) float64

Average calculates the average of a float64 slice

func CalculateColumnWidths

func CalculateColumnWidths(totalWidth, n int) []int

CalculateColumnWidths distributes the total width among n columns

func FastBytes added in v0.6.0

func FastBytes(value uint64) string

func FastCpu added in v0.5.0

func FastCpu(val float64) string

func FastFloat1 added in v0.5.0

func FastFloat1(val float64) string

func FastFloat2 added in v0.5.0

func FastFloat2(val float64) string

func FastGb added in v0.5.0

func FastGb(value uint64) string

func FastInt added in v0.5.0

func FastInt(val int) string

func FastInt64 added in v0.5.0

func FastInt64(val int64) string

func FastMb added in v0.5.0

func FastMb(value uint64) string

func FastMbPerSec added in v0.5.0

func FastMbPerSec(val float64) string

func FastMbUsed added in v0.5.0

func FastMbUsed(total, used string) string

func FastMem added in v0.5.0

func FastMem(val float64) string

func FastMhz added in v0.5.0

func FastMhz(val int) string

func FastPctWithPrefix added in v0.5.0

func FastPctWithPrefix(prefix string, val float64) string

func FastPercent added in v0.5.0

func FastPercent(val float64) string

func FastPercent1 added in v0.5.0

func FastPercent1(val float64) string

func FastTemp added in v0.5.0

func FastTemp(val float64) string

func FastUint64 added in v0.5.0

func FastUint64(val uint64) string

func FastWatts added in v0.5.0

func FastWatts(val float64) string

func FormatBytes

func FormatBytes(bytes uint64) string

FormatBytes formats bytes into human-readable format

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration formats a duration into human-readable format

func FullWidthBg

func FullWidthBg(s string, width int) string

FullWidthBg fills a string to the given width with spaces using lipgloss

func Max

func Max(data []float64) float64

Max returns the maximum value in a float64 slice

func Min

func Min(data []float64) float64

Min returns the minimum value in a float64 slice

func PadLeft added in v0.5.0

func PadLeft(s string, w int) string

PadLeft pads string s with spaces on the left to visual width w

func PadRight added in v0.5.0

func PadRight(s string, w int) string

PadRight pads string s with spaces on the right to visual width w

func Truncate added in v0.5.0

func Truncate(s string, w int) string

Truncate truncates string s to visual width w

Types

This section is empty.

Jump to

Keyboard shortcuts

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