sysinfo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type All

type All struct {
	Desktop        Desktop         `json:"desktop"`
	Disks          []Disk          `json:"disks"`
	Hardware       Hardware        `json:"hardware"`
	NetworkDevices []NetworkDevice `json:"network_devices"`
	OS             OS              `json:"os"`
	Packages       Packages        `json:"packages"`
	Status         Status          `json:"status"`
}

func GatherAll

func GatherAll() (*All, error)

type CPU

type CPU struct {
	Model string `json:"model"`
	Arch  string `json:"arch"`
}

func GatherCPUs

func GatherCPUs() ([]CPU, error)

type Desktop

type Desktop struct {
	Name     string          `json:"name"`
	Protocol DisplayProtocol `json:"protocol"`
}

func GatherDesktop

func GatherDesktop() (*Desktop, error)

type Disk

type Disk struct {
	Model      string `json:"model"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Controller string `json:"controller"`
}

func GatherDisks

func GatherDisks() ([]Disk, error)

type DisplayProtocol

type DisplayProtocol int
const (
	Unknown DisplayProtocol = iota
	Wayland
	X11
)

func (DisplayProtocol) String

func (dp DisplayProtocol) String() string

type GPU

type GPU struct {
	Name   string `json:"name"`
	Driver string `json:"driver"`
}

func GatherGPUs

func GatherGPUs() ([]GPU, error)

type Hardware

type Hardware struct {
	Vendor         string `json:"vendor"`
	Product        string `json:"product"`
	CPUs           []CPU  `json:"cpus"`
	GPUs           []GPU  `json:"gpus"`
	PhysicalMemory uint64 `json:"physical_memory"`
	UsableMemory   uint64 `json:"usable_memory"`
	Swap           uint64 `json:"swap"`
}

func GatherHardware

func GatherHardware() (*Hardware, error)

type NetworkDevice

type NetworkDevice struct {
	Interface string `json:"interface"`
	Type      string `json:"type"`
	Connected bool   `json:"connected"`
}

func GatherNetworkDevices

func GatherNetworkDevices() ([]NetworkDevice, error)

type OS

type OS struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Variant string `json:"variant"`
	Atomic  bool   `json:"atomic"`
}

func GatherOS

func GatherOS() (*OS, error)

type Packages

type Packages struct {
	RPMCount           int `json:"rpm_count"`
	SystemFlatpakCount int `json:"system_flatpak_count"`
	UserFlatpakCount   int `json:"user_flatpak_count"`
}

func GatherPackages

func GatherPackages() (*Packages, error)

type Status

type Status struct {
	Uptime         time.Duration `json:"uptime"`
	Kernel         string        `json:"kernel"`
	RootDiskFree   uint64        `json:"root_disk_free"`
	RootFilesystem string        `json:"root_filesystem"`
}

func GatherStatus

func GatherStatus() (*Status, error)

Jump to

Keyboard shortcuts

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