runtime

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func CWD

func CWD() string

Get the current work directory

func GetFuncName

func GetFuncName() string

Get the current rinning function name

Types

type Hardware added in v0.8.1

type Hardware struct {
	Os   HwOs   `json:"os"`
	Cpu  HwCpu  `json:"cpu"`
	Rrm  HwRrm  `json:"ram"`
	Disk HwDisk `json:"disk"`
}

type HwCpu added in v0.8.1

type HwCpu struct {
	Cpus  []float64 `json:"cpus"`
	Cores int       `json:"cores"`
}

func HwCpuInfo added in v0.8.1

func HwCpuInfo() (c HwCpu, err error)

type HwDisk added in v0.8.1

type HwDisk struct {
	UsedMB      int `json:"usedMb"`
	UsedGB      int `json:"usedGb"`
	TotalMB     int `json:"totalMb"`
	TotalGB     int `json:"totalGb"`
	UsedPercent int `json:"usedPercent"`
}

func HwDiskInfo added in v0.8.1

func HwDiskInfo() (d HwDisk, err error)

type HwOs added in v0.8.1

type HwOs struct {
	GOOS         string `json:"goos"`
	NumCPU       int    `json:"numCpu"`
	Compiler     string `json:"compiler"`
	GoVersion    string `json:"goVersion"`
	NumGoroutine int    `json:"numGoroutine"`
}

func HwOsInfo added in v0.8.1

func HwOsInfo() (o HwOs)

type HwRrm added in v0.8.1

type HwRrm struct {
	UsedMB      int `json:"usedMb"`
	TotalMB     int `json:"totalMb"`
	UsedPercent int `json:"usedPercent"`
}

func HwRamInfo added in v0.8.1

func HwRamInfo() (r HwRrm, err error)

Jump to

Keyboard shortcuts

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