utils

package
v1.0.0-beta.29 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FmtBytes

func FmtBytes(bytes uint64) string

FmtBytes converts bytes to a printable string with unit

func FmtPretty

func FmtPretty(v interface{}) string

FmtPretty converts any interface to JSON with indentation, for use in logging where better readability is required. Errors are ignored.

func IsPrimitive

func IsPrimitive(p interface{}) bool

IsPrimitive takes any variable and returns true if the underlying type is a primitive type

func IsRootUser

func IsRootUser() bool

func IsTerminalOutput

func IsTerminalOutput() bool

func SplitPathIntoDirectories

func SplitPathIntoDirectories(p string) []string

SplitPathIntoDirectories takes a file path and returns a slice of strings containing the individual directory names that makes up the path

func StringToBytes

func StringToBytes(sizeString string) (uint64, error)

func SubDirectories

func SubDirectories(dirPath string) ([]string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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