🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/serak/go-sysinfo

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/serak/go-sysinfo

v1.7.1
Source
Go
Version published
Created
Source

go-sysinfo

Build Status Go Documentation

go-sysinfo is a library for collecting system information. This includes information about the host machine and processes running on the host.

The available features vary based on what has been implemented by the "provider" for the operating system. At runtime you check to see if additional interfaces are implemented by the returned Host or Process. For example:

process, err := sysinfo.Self()
if err != nil {
	return err
}

if handleCounter, ok := process.(types.OpenHandleCounter); ok {
	count, err := handleCounter.OpenHandleCount()
	if err != nil {
		return err
	}
	log.Printf("%d open handles", count)
}

These tables show what methods are implemented as well as the extra interfaces that are implemented.

Host FeaturesDarwinLinuxWindowsAIX/ppc64
Info()xxxx
Memory()xxxx
CPUTimerxxxx
VMStatx
NetworkCountersx
Process FeaturesDarwinLinuxWindowsAIX/ppc64
Info()xxxx
Memory()xxxx
User()xxxx
Parent()xxxx
CPUTimerxxxx
Environmentxxx
OpenHandleEnumeratorx
OpenHandleCounterx
Seccompx
Capabilitiesx
NetworkCountersx

FAQs

Package last updated on 11 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts