utils

package
v0.0.0-...-3b6e570 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Byte   = 0
	KB     = 1
	MB     = 2
	GB     = 3
	TB     = 4
	KB_DIV = float64(1 << 10)
	MB_DIV = float64(1 << 20)
	GB_DIV = float64(1 << 30)
	TB_DIV = float64(1 << 40)
)

Variables

This section is empty.

Functions

func CanReadFile

func CanReadFile(path string) bool

Check if file can be read

func CommandExists

func CommandExists(cmd string) bool

Check if Command Exists

func ConvertNetworkUnitOfMeasureToID

func ConvertNetworkUnitOfMeasureToID(measure string) uint8

Return String Measure to Measure ID

func ConvertToUnitOfMeasure

func ConvertToUnitOfMeasure(value float64, measureId uint8) float64

Convert Unit of Measure

func FileExists

func FileExists(filename string) bool

func GetNetworkUnitOfMeasure

func GetNetworkUnitOfMeasure(measureId uint8) string

Return Network Unit of Measure

func ReadFileToString

func ReadFileToString(path string) (string, error)

Read a file to string

func StripSpecialChars

func StripSpecialChars(str string, forceLower bool) string

Strip Special Characters

func ValuePrecision

func ValuePrecision(value float64, precision int) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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