util

package
v0.0.0-...-6ee14ab Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectNetworkConfig

func CollectNetworkConfig() (map[string][]net.IP, error)

func GetFileSystemInfo

func GetFileSystemInfo(path string) (total uint64, free uint64, err error)

GetFileSystemInfo retrieves information about the file system.

func GetMemoryChipInfo

func GetMemoryChipInfo() (string, error)

func GetOSInfo

func GetOSInfo() (map[string]string, error)

GetOSInfo collects OS-specific release info

func GetRunningProcesses

func GetRunningProcesses() ([]string, error)

func HomeDir

func HomeDir() string

func Uname

func Uname() (string, string)

uname -sm

Types

type CpuInfo

type CpuInfo struct {
	CPU       int32
	VendorID  string
	ModelName string
	Cores     int32
	Mhz       float64
	Usage     []float64
}

CpuInfo holds information about a CPU.

func GetCpuInfo

func GetCpuInfo() ([]CpuInfo, error)

GetCpuInfo retrieves and returns information about the CPUs.

type DiskInfo

type DiskInfo struct {
	Device      string
	MountPoint  string
	Filesystem  string
	Total       uint64
	Used        uint64
	Free        uint64
	UsedPercent float64
}

func GetDiskInfo

func GetDiskInfo() ([]DiskInfo, error)

GetDiskInfo retrieves info about the disk usage.

type MemoryStats

type MemoryStats struct {
	Total       uint64
	Available   uint64
	Used        uint64
	UsedPercent float64
}

func GetMemoryStats

func GetMemoryStats() (*MemoryStats, error)

GetMemoryStats retrieves info about the memory usage.

type ShellInfo

type ShellInfo struct {
	Name    string
	Path    string
	Version string
}

func GetShellVersion

func GetShellVersion() (*ShellInfo, error)

GetShellVersion determines the current shell and retrieves its version.

type SystemInfo

type SystemInfo struct {
	OS        string
	Arch      string
	OSInfo    map[string]string
	ShellInfo *ShellInfo

	EnvVarNames string
	WorkDir     string
}

func CollectSystemInfo

func CollectSystemInfo() (*SystemInfo, error)

Jump to

Keyboard shortcuts

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