Documentation
¶
Index ¶
- func CalculatePercentage(used, total float64) float64
- func CalculatePercentageInt(used, total int64) float64
- func FormatBytes(bytes int64) string
- func FormatBytesFloat(gb float64) string
- func FormatPendingStatusIndicator(status string, isPending bool, operation string) string
- func FormatStatusIndicator(status string) string
- func FormatUptime(uptime int) string
- func TrimTrailingWhitespace(s string) string
- func WaitForEnter()
- func WaitForEnterToReturn(err error, successMsg, failureMsg string)
- func WaitForReturnWithCountdown(seconds int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePercentage ¶
CalculatePercentage safely calculates percentage from used and total values Returns 0.0 if total is 0 to avoid division by zero.
func CalculatePercentageInt ¶
CalculatePercentageInt safely calculates percentage from used and total int64 values Returns 0.0 if total is 0 to avoid division by zero.
func FormatBytes ¶
FormatBytes formats a byte count to a human-readable format with dynamic units Always shows 2 decimal places and chooses the most appropriate unit (GB, TB, PB).
func FormatBytesFloat ¶
FormatBytesFloat converts float64 GB values to human-readable format Input is assumed to be in GB, converts to appropriate units with 2 decimal places.
func FormatPendingStatusIndicator ¶
FormatPendingStatusIndicator returns a status indicator with pending state visual feedback. Shows a dimmed indicator with a pulsing effect for pending operations.
func FormatStatusIndicator ¶
FormatStatusIndicator returns a string with a colored status emoji. Uses theme-aware color tags.
func FormatUptime ¶
FormatUptime formats the uptime in seconds to a human-readable format.
func TrimTrailingWhitespace ¶
TrimTrailingWhitespace removes all trailing whitespace (spaces, tabs, newlines, carriage returns) from the end of the string.
func WaitForEnter ¶
func WaitForEnter()
WaitForEnter waits for the user to press Enter before continuing. This is useful for pausing execution and waiting for user acknowledgment.
func WaitForEnterToReturn ¶
WaitForEnterToReturn displays a status message and waits for the user to press Enter before returning to the TUI. This provides a consistent experience across all suspend/resume operations.
func WaitForReturnWithCountdown ¶
func WaitForReturnWithCountdown(seconds int)
WaitForReturnWithCountdown waits for a specified number of seconds, displaying a countdown, before returning to the TUI.
Types ¶
This section is empty.