system

package
v0.0.0-...-4ea7438 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

type CPU struct {
	Nums      int32     `json:"nums"`       //核心数
	Cores     int       `json:"cores"`      //核心数
	UsageRate []float64 `json:"usage_rate"` //cpu使用率
}

func GetCPUInfo

func GetCPUInfo() (info CPU, err error)

type Disk

type Disk struct {
	Drive     string  `json:"drive"`      //盘符
	FS        string  `json:"fs"`         //文件系统
	Total     uint64  `json:"total"`      //总大小
	Usable    uint64  `json:"usable"`     //可用大小
	Usage     uint64  `json:"usage"`      //已用大小
	UsageRate float64 `json:"usage_rate"` //已用百分比
}

func GetDiskInfo

func GetDiskInfo() (info []Disk, err error)

type Go

type Go struct {
	Lang      string //语言环境
	Path      string //安装路径
	StartTime string //启动时间
	Version   string //版本
	RunTime   string //运行时长
}

func GetGoInfo

func GetGoInfo() (info Go, err error)

type Host

type Host struct {
	Name       string `json:"name"`        //服务器名称
	OS         string `json:"os"`          //操作系统
	IP         string `json:"ip"`          //服务器IP
	FrameWork  string `json:"frame_work"`  //系统架构
	UpdateTime uint64 `json:"update_time"` //更新时间
	BootTime   uint64 `json:"boot_time"`   //重启时间
}

func GetHostInfo

func GetHostInfo() (info Host, err error)

type Mem

type Mem struct {
	Total       uint64  `json:"total"`
	Free        uint64  `json:"free"`
	UsedPercent float64 `json:"used_percent"`
}

func GetMemInfo

func GetMemInfo() (info Mem, err error)

type Net

type Net struct {
	Name      string `json:"name"`
	BytesSent uint64 `json:"bytes_sent"`
	BytesRecv uint64 `json:"bytes_recv"`
}

func GetNetInfo

func GetNetInfo() (info []Net, err error)

type Process

type Process struct {
	Name       string  `json:"name"`
	UserName   string  `json:"user_name"`
	Pid        int32   `json:"pid"`
	CpuPercent float64 `json:"cpu_percent"`
	MemPercent int64   `json:"mem_percent"`
	CreateTime float32 `json:"create_time"`
}

func GetProcessInfo

func GetProcessInfo(filterUserName string) (info []Process, err error)

Jump to

Keyboard shortcuts

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