Documentation ¶
Index ¶
- Constants
- func BooleanToInteger(value bool) int
- func ConvertFromStringToInteger(sizeStr string, targetUnit string) (int64, error)
- func ConvertToBytes(sizeStr string) (int64, error)
- func ConvertToGigabytes(sizeStr string) (int64, error)
- func ConvertToKilobytes(sizeStr string) (int64, error)
- func ConvertToMegabytes(sizeStr string) (int64, error)
- func ConvertToTerabytes(sizeStr string) (int64, error)
- func ExecuteCommand(command string, arguments ...string) (string, error)
- func ExpandHomeDir(path string) (string, error)
- func GetCoreCount() int
- func GetTotalMemory() uint64
- func IntegerToBoolean(value int) bool
- func IsInSameNetwork(ip string, network string) bool
- func IsNumeric(s string) bool
- func IsValidIP(ip string) bool
- func IsValidIPWithSubnet(address string) bool
- func ParseSizeForFromStringToInteger(sizeStr string) (int64, string, error)
- func RemoveEmptyStringsFromSlice(slice []string) []string
Constants ¶
const ( Byte = 1 Kilobyte = 1024 * Byte Megabyte = 1024 * Kilobyte Gigabyte = 1024 * Megabyte Terabyte = 1024 * Gigabyte )
Variables ¶
This section is empty.
Functions ¶
func BooleanToInteger ¶
BooleanToInteger converts a boolean value to an integer.
func ConvertFromStringToInteger ¶
ConvertFromStringToInteger converts a size string to an integer.
func ConvertToBytes ¶
ConvertToBytes converts a size string to bytes.
func ConvertToGigabytes ¶
ConvertToGigabytes converts a size string to gigabytes.
func ConvertToKilobytes ¶
ConvertToKilobytes converts a size string to kilobytes.
func ConvertToMegabytes ¶
ConvertToMegabytes converts a size string to megabytes.
func ConvertToTerabytes ¶
ConvertToTerabytes converts a size string to terabytes.
func ExecuteCommand ¶
ExecuteCommand executes a command and returns the output.
func ExpandHomeDir ¶
ExpandHomeDir expands the home directory.
func GetTotalMemory ¶
func GetTotalMemory() uint64
GetTotalMemory returns the total memory on the machine
func IntegerToBoolean ¶
IntegerToBoolean converts an integer value to a boolean.
func IsInSameNetwork ¶
IsInSameNetwork checks if the given IP address is in the same network.
func IsValidIPWithSubnet ¶
IsValidIPWithSubnet checks if the given string is a valid IP with subnet.
func ParseSizeForFromStringToInteger ¶
ParseSizeForFromStringToInteger parses a size string to an integer.
func RemoveEmptyStringsFromSlice ¶
RemoveEmptyStringsFromSlice removes empty strings from a slice.
Types ¶
This section is empty.