Documentation ¶
Index ¶
- Constants
- func BlkLabelAscSorter(a, b string) bool
- func BytesToUint32(b []byte) uint32
- func BytesToUint64(b []byte) uint64
- func CastToFloat64(value interface{}) (float64, error)
- func ConvUnit(value float64, mlt float64, target float64, fit bool) (string, error)
- func ConvUnitBin(value interface{}, target float64) (string, error)
- func ConvUnitBinFit(value interface{}, target float64) (string, error)
- func ConvUnitDec(value interface{}, target float64) (string, error)
- func ConvUnitDecFit(value interface{}, target float64) (string, error)
- func DumpBinary(in interface{}) string
- func Exec(c string, arg ...string) (string, error)
- func Executable(path string) bool
- func Exists(path string) bool
- func FilterFiles(path string, filter func(os.FileInfo) bool) []string
- func FilterPrefixedDirs(path, prefix string) []string
- func FilterPrefixedFiles(path, prefix string) []string
- func FilterPrefixedLinks(path, prefix string) []string
- func FindMSB(b interface{}) (int, error)
- func HasPrefixIn(l string, ptns ...string) bool
- func IPv4MaskSize(mask string) int
- func LoadByte(path string) (byte, error)
- func LoadBytes(path string) ([]byte, error)
- func LoadString(path string) (string, error)
- func LoadUint16(path string) (uint16, error)
- func LoadUint32(path string) (uint32, error)
- func LoadUint64(path string) (uint64, error)
- func Round(f float64, pt int) float64
- func SanitizeString(str string) string
- func ScanPathList(list []string) (string, error)
- func ShortenProcName(str string) string
- func ShortenVendorName(str string) string
Constants ¶
const ( BaseDecimal = 1000.0 BaseBinary = 1024.0 )
Multiplier value
const ( BYTE = iota KILO MEGA GIGA TERA PETA EXA ZETTA YOTTA )
Units value
Variables ¶
This section is empty.
Functions ¶
func BlkLabelAscSorter ¶
BlkLabelAscSorter is the sorter for sort.Slice() to sort block device labels by asc
func CastToFloat64 ¶
CastToFloat64 converts the given value to float64
func ConvUnit ¶
ConvUnit returns the string representation of value in given base with given unit. The unit will be optimized automatically if fit is true.
func ConvUnitBin ¶
ConvUnitBin returns the string representation of value in 1024 base with given unit.
func ConvUnitBinFit ¶
ConvUnitBinFit returns the string representation of value in 1024 base with given unit. The unit will be optimized automatically.
func ConvUnitDec ¶
ConvUnitDec returns the string representation of value in 1000 base with given unit.
func ConvUnitDecFit ¶
ConvUnitDecFit returns the string representation of value in 1000 base with given unit. The unit will be optimized automatically.
func DumpBinary ¶
func DumpBinary(in interface{}) string
DumpBinary returns the string that represents the value as binary array
func Executable ¶
Executable returns if the file named by path is executable
func FilterFiles ¶
FilterFiles returns filtered items by filter function
func FilterPrefixedDirs ¶
FilterPrefixedDirs returns filtered directories which has given prefix
func FilterPrefixedFiles ¶
FilterPrefixedFiles returns filtered regular files which has given prefix
func FilterPrefixedLinks ¶
FilterPrefixedLinks returns filtered symlinks which has given prefix
func HasPrefixIn ¶
HasPrefixIn returns true if given string has one of prefix
func IPv4MaskSize ¶
IPv4MaskSize returns mask size of given string representation
func LoadString ¶
LoadString reads the file named by path and returns the contens as string
func LoadUint16 ¶
LoadUint16 reads the file named by path and returns the contents as uint16
func LoadUint32 ¶
LoadUint32 reads the file named by path and returns the contents as uint32
func LoadUint64 ¶
LoadUint64 reads the file named by path and returns the contents as uint64
func SanitizeString ¶
SanitizeString returns string with all unuseful words
func ScanPathList ¶
ScanPathList returns path which was found by firtst from the list
func ShortenProcName ¶
ShortenProcName returns short version processor name
func ShortenVendorName ¶
ShortenVendorName returns short version vendor name
Types ¶
This section is empty.