system

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(bytes uint64) string

FormatBytes converts bytes to human-readable format

Types

type CPUStats

type CPUStats struct {
	Cores      int `json:"cores"`      // Number of CPU cores
	Goroutines int `json:"goroutines"` // Number of active goroutines
}

CPUStats contains CPU statistics

type DiskStats

type DiskStats struct {
	Total   uint64  `json:"total"`   // Total disk space in bytes
	Free    uint64  `json:"free"`    // Free disk space in bytes
	Used    uint64  `json:"used"`    // Used disk space in bytes
	Percent float64 `json:"percent"` // Usage percentage (0-100)
}

DiskStats contains disk usage statistics

type DiskUsage

type DiskUsage struct {
	Total uint64
	Free  uint64
}

DiskUsage represents disk usage statistics

func GetDiskUsage

func GetDiskUsage(path string) DiskUsage

GetDiskUsage returns raw disk usage for the given path. It is a thin wrapper around the platform-specific getDiskUsage.

type MemoryStats

type MemoryStats struct {
	Total     uint64  `json:"total"`     // Total memory in bytes
	Available uint64  `json:"available"` // Available memory in bytes
	Used      uint64  `json:"used"`      // Used memory in bytes
	Percent   float64 `json:"percent"`   // Usage percentage (0-100)
}

MemoryStats contains memory usage statistics

type SystemStats

type SystemStats struct {
	Memory MemoryStats `json:"memory"`
	Disk   DiskStats   `json:"disk"`
	CPU    CPUStats    `json:"cpu"`
}

SystemStats contains system resource statistics

func GetSystemStats

func GetSystemStats(sharedDir string) SystemStats

GetSystemStats collects current system statistics

Jump to

Keyboard shortcuts

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