common

package
v0.0.0-...-c603b20 Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ByteUnits is a k=>v map of units for conversion
	ByteUnits = map[int]string{
		0: "B",
		1: "kB",
		2: "MB",
		3: "GB",
		4: "TB",
	}
)
View Source
var FactdVersion = "unknown"

FactdVersion will be set via init. In the default command implementation it is passed from the build process

Functions

func ConvertBytes

func ConvertBytes(in uint64) (float64, string, error)

ConvertBytes converts bytes to the highest possible unit

func ConvertBytesTo

func ConvertBytesTo(in uint64, maxUnit string) (float64, string, error)

ConvertBytesTo converts bytes to the specified unit

func ConvertNetmask

func ConvertNetmask(in uint8) (string, error)

ConvertNetmask converts CIDR (netmask) to Netmask

func GetHostSys

func GetHostSys() string

GetHostSys gets an env var that is shared with gopsutil

Types

type FactList

type FactList map[string]interface{}

FactList is a map of data returned from a plugin to be printed by a formatter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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