resource

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

Functions

func Avaible

func Avaible() int

func Ccount

func Ccount() float64

func Class

func Class() string

func Cores

func Cores() (int, int)

Cores 返回单个CPU的物理内核数和总逻辑内核个数

func Cpu

func Cpu() (float64, float64)

func Fstab

func Fstab() []string

func Mcount

func Mcount() (int, int, int, float64)

func Memory

func Memory() (float64, float64)

func Physical

func Physical() int

Physical 返回物理CPU个数

func Total

func Total() int

func Used

func Used() int

Types

type DiskStatus

type DiskStatus struct {
	All  uint64 `json:"all"`
	Used uint64 `json:"used"`
	Free uint64 `json:"free"`
}

func DiskUsage

func DiskUsage(path string) (disk DiskStatus)

disk usage of path/disk

type Diskslice

type Diskslice struct {
	Path    string
	Total   int64
	Used    float64
	UsePerc float64
}

func Dcount

func Dcount() []Diskslice

type Sys

type Sys struct {
	Hostname string
	Os       string
	Release  string
	Arch     string
	Systime  string
	Zone     string
}

func Sysinfo

func Sysinfo() (info Sys)

Jump to

Keyboard shortcuts

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