Documentation
¶
Index ¶
- Constants
- func CPUCount() int
- func CPUInfo() []cpu.InfoStat
- func GetArch() string
- func GetHostname() string
- func GetMemUsed() uint64
- func GetMemUsedPercent() float64
- func GetOS() string
- func GetPlatform() string
- func GetPlatformVersion() string
- func GetProcStat(pid int) ([]string, error)
- func GetSwapTotal() uint64
- func GetSwapUsed() uint64
- func GetSwapUsedPercent() float64
- func GetTotalMem() uint64
- func IsAix() bool
- func IsArch64() bool
- func IsContainer() bool
- func IsDarwin() bool
- func IsFreeBsd() bool
- func IsLinux() bool
- func IsOpenBsd() bool
- func IsSmartOs() bool
- func IsSunOs() bool
- func IsWindows() bool
- func IsX86() bool
- func PerCPUPercent() []float64
- func TerminateProcess(pid int, timeout int, force bool) error
- func TerminateWithPidFile(path string, timeout int, force bool) error
- func TotalCPUPercent() []float64
- func VCPUCount() int
- type ScanPort
Constants ¶
View Source
const ( TCP = "tcp" UDP = "udp" )
Variables ¶
This section is empty.
Functions ¶
func GetHostname ¶ added in v1.0.1
func GetHostname() string
func GetMemUsed ¶ added in v1.0.1
func GetMemUsed() uint64
func GetMemUsedPercent ¶ added in v1.0.1
func GetMemUsedPercent() float64
func GetPlatform ¶ added in v1.0.1
func GetPlatform() string
func GetPlatformVersion ¶ added in v1.0.1
func GetPlatformVersion() string
func GetProcStat ¶
GetProcStat
Description:
will try to get process's state if it is existed. when process does not exist, the function will return an error.
Returns:
[]string: Status returns the process status. Return value could be one of these. R: Running S: Sleep T: Stop I: Idle Z: Zombie W: Wait L: Lock The character
func GetSwapTotal ¶ added in v1.0.1
func GetSwapTotal() uint64
func GetSwapUsed ¶ added in v1.0.1
func GetSwapUsed() uint64
func GetSwapUsedPercent ¶ added in v1.0.1
func GetSwapUsedPercent() float64
func GetTotalMem ¶ added in v1.0.1
func GetTotalMem() uint64
func IsContainer ¶ added in v1.0.1
func IsContainer() bool
func PerCPUPercent ¶ added in v1.0.1
func PerCPUPercent() []float64
func TerminateProcess ¶
TerminateWithPidFile
Description:
will try reading pid file and terminate the process.
Args:
timeout: max second waiting termination. force: whether using signal.SIGKILL when signal.SIGTERM failed.
func TerminateWithPidFile ¶
TerminateWithPidFile
Description:
will try reading pid file and terminate the process.
Args:
path: pid file path. timeout: max second waiting termination. force: whether using signal.SIGKILL when signal.SIGTERM failed.
func TotalCPUPercent ¶ added in v1.0.1
func TotalCPUPercent() []float64
Types ¶
type ScanPort ¶ added in v1.0.1
func NewScanPort ¶ added in v1.0.1
Click to show internal directories.
Click to hide internal directories.