Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFolderSize ¶ added in v1.1.5
GetFolderSize returns the size of the specified folder in bytes.
Types ¶
type CPUInfo ¶
CPUInfo contains information about the server's processor.
func GetCPUInfo ¶
func GetCPUInfo() CPUInfo
GetCPUInfo returns information about the server's processor, including the number of cores and the current CPU usage.
type DiskInfo ¶
DiskInfo is a structure that contains information about the server's disk space. It includes the total, used and available space on the system. This structure is used by the GetDiskInfo function, which is called in the GetInfoServer function function to collect information about the server's disk.
func GetDiskInfo ¶
GetDiskInfo returns information about the disk space on the specified path. This function is called inside the GetInfoServer function to get information about the server's disk. It uses syscall.Statfs to access file system statistics and calculate space values.
type DistroInfo ¶
type DistroInfo struct { PrettyName string Name string VersionID string Version string VersionCodeName string ID string HomeURL string SupportURL string BugReportURL string }
DistroInfo contains information about the operating system distribution.
func GetDistroInfo ¶
func GetDistroInfo() (DistroInfo, error)
GetDistroInfo retrieves information about the operating system distribution.
type HardwareInfo ¶
type HardwareInfo struct { KernelVersion string ProcessorName string Uptime int SwapTotal int SwapFree int }
HardwareInfo is a structure that contains information about the server's hardware, such as kernel version, processor name, uptime and swap information. This information can be collected by the GetHardwareInfo function and is part of the information returned by GetInfoServer.
func GetHardwareInfo ¶
func GetHardwareInfo() HardwareInfo
GetHardwareInfo is a function that retrieves information about the system's hardware. It uses operating system commands to extract data about the kernel version, the processor name, the server uptime and the swap area (total and free). This data is then returned in the HardwareInfo structure. The function is called within GetInfoServer to collect information about the server's hardware.
type NetworkInfo ¶
type NetworkInfo struct { IPv4 []string IPv6 []string IPv4Ports PortType IPv6Ports PortType Download int64 Upload int64 }
NetworkInfo holds the network information.
func GetNetworkInfo ¶
func GetNetworkInfo() NetworkInfo
GetNetworkInfo retrieves the network information.
type RAMInfo ¶
RAMInfo is a structure that contains information about the system's RAM memory. It is used to store data about the total, usage and availability of RAM memory. This information can be collected by the GetRAMInfo function and is part of the information returned by GetInfoServer.
func GetRAMInfo ¶
func GetRAMInfo() RAMInfo
GetRAMInfo is a function that retrieves information about the system's RAM memory. It reads the `/proc/meminfo` file to obtain data on total and available memory, and calculates the memory used. The function returns this data in the RAMInfo structure. It is called inside GetInfoServer to collect information about the server's RAM.
type ServerInfo ¶
type ServerInfo struct { Distribution DistroInfo RAM RAMInfo Disk DiskInfo CPU CPUInfo Network NetworkInfo Hardware HardwareInfo }
ServerInfo is a structure that groups together various pieces of information about the server. This structure is used to return all the data collected about the server in a single response. It contains substructures that store specific information about the system, such as distribution, memory, disk, CPU, network and hardware. This information is collected by the GetInfoServer function.