Documentation
¶
Index ¶
- func CPUInfo() (cores int, used, free float64, err error)
- func DiskInfo() (total, used, free uint64, err error)
- func MemoryInfo() (total, used, free uint64, err error)
- func NetworkInfo() (sent, recv uint64, err error)
- func Uptime() (time.Duration, error)
- func UptimeI18n(dayTitle, hourTitle, minuteTitle, separator string) (string, error)
- func UptimeParts() (days, hours, minutes uint64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CPUInfo ¶
CPUInfo retrieves the number of CPU cores, the CPU usage percentage, and calculates the used and free CPU percentages. It returns the number of cores, used percentage, free percentage, and an error if any occurs.
func DiskInfo ¶
DiskInfo retrieves disk usage statistics for the root directory ("/"). It returns the total, used, and free disk space in bytes, along with any error encountered.
func MemoryInfo ¶
MemoryInfo retrieves the system's memory statistics. It returns the total, used, and free memory in bytes, along with any error encountered.
func NetworkInfo ¶
NetworkInfo retrieves the total bytes sent and received on the network interfaces. It returns the number of bytes sent, bytes received, and an error if any occurs.
func Uptime ¶
Uptime retrieves the system uptime and returns it as a time.Duration. It returns an error if the uptime cannot be determined.
func UptimeI18n ¶
UptimeI18n retrieves the system uptime and formats it as a localized string. The titles for days, hours, and minutes, as well as the separator, are provided as arguments.
func UptimeParts ¶
UptimeParts retrieves the system uptime and returns it as days, hours, and minutes. It also returns an error if the uptime cannot be determined.
Types ¶
This section is empty.