Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateCPUPercent

func CalculateCPUPercent(stats container.StatsResponse) float64

func CalculateMemoryPercent

func CalculateMemoryPercent(stats container.StatsResponse) float64

func CreatedAgo

func CreatedAgo(ts int64) string

func FormatDuration

func FormatDuration(d time.Duration) string

func FormatMounts

func FormatMounts(mounts []container.MountPoint) string

func FormatPorts

func FormatPorts(ports []container.Port) string

func FormatSize

func FormatSize(bytes int64) string

func GetCfgDir

func GetCfgDir() string

func ReturnError

func ReturnError(loc, title string, err error) tea.Cmd

func ReturnMsg

func ReturnMsg(loc, title, msg string) tea.Cmd

func ShortID

func ShortID(id string) string

func Shorten

func Shorten(s string, max int) string

func ToAnySlice

func ToAnySlice[T any](in []T) []any

func WrapAndLimit

func WrapAndLimit(s string, maxLen, maxLines int) string

Wraps the text to the given length and also limits no. of lines, adds a "..." line if exceeding.

Types

This section is empty.

Jump to

Keyboard shortcuts

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