host

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostInfo

type HostInfo struct {
	Hostname        string `json:"hostname"`        //主机名称
	Uptime          uint64 `json:"uptime"`          //已运行时间,单位秒
	BootTime        string `json:"bootTime"`        //启动时间,格式:2006-01-02 15:04:05
	Procs           uint64 `json:"procs"`           // 进程数量
	OS              string `json:"os"`              // ex: freebsd, linux
	Platform        string `json:"platform"`        // ex: ubuntu, linuxmint
	PlatformFamily  string `json:"platformFamily"`  // ex: debian, rhel
	PlatformVersion string `json:"platformVersion"` // version of the complete OS
	KernelVersion   string `json:"kernelVersion"`   // version of the OS kernel (if available)
	KernelArch      string `json:"kernelArch"`      // native cpu architecture queried at runtime, as returned by `uname -m` or empty string in case of error
	HostID          string `json:"hostId"`          // ex: uuid
	LastTime        string `json:"lastTime"`        //采集时间
}

HostInfo 主机信息

func GetHostInfo

func GetHostInfo() *HostInfo

GetHostInfo 获取主机信息

func NewHostInfo

func NewHostInfo() *HostInfo

NewHostInfo New Host info

func (HostInfo) String

func (o HostInfo) String() string

Jump to

Keyboard shortcuts

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