hostmetadata

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HostEtc = func() string {
	if etcPath := os.Getenv("HOST_ETC"); etcPath != "" {
		return etcPath
	}
	return "/etc"
}

HostEtc is the path to host etc and can be set using the env var "HOST_ETC" this is to maintain consistency with gopsutil

Functions

func GetLinuxVersion

func GetLinuxVersion() (string, error)

GetLinuxVersion - adds information about the host linux version to the supplied map

Types

type CPU

type CPU struct {
	HostPhysicalCPUs int
	HostLogicalCPUs  int
	HostCPUCores     int64
	HostCPUModel     string
	HostMachine      string
	HostProcessor    string
}

CPU information about the host

func GetCPU

func GetCPU() (info *CPU, err error)

GetCPU - adds information about the host cpu to the supplied map

func (*CPU) ToStringMap

func (c *CPU) ToStringMap() map[string]string

ToStringMap returns the CPU as a string map

type Memory

type Memory struct {
	Total dataunit.Size
}

Memory stores memory collected from the host

func GetMemory

func GetMemory() (*Memory, error)

GetMemory returns the amount of memory on the host as datatype.USize

func (*Memory) ToStringMap

func (m *Memory) ToStringMap() map[string]string

ToStringMap returns a map of key/value metadata about the host memory where memory sizes are reported in Kb

type OS

type OS struct {
	HostOSName        string
	HostKernelName    string
	HostKernelRelease string
	HostKernelVersion string
	HostLinuxVersion  string
}

OS is a struct containing information about the host os

func GetOS

func GetOS() (info *OS, err error)

GetOS returns a struct with information about the host os

func (*OS) ToStringMap

func (o *OS) ToStringMap() map[string]string

ToStringMap returns a map of key/value metadata about the host os

Jump to

Keyboard shortcuts

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