Полная зачистка legacy + закрытие fix24.1/fix24.2 + обновление логотипа
This commit is contained in:
@@ -78,6 +78,10 @@ func GetMemPercent() (float64, error) {
|
||||
return value, err
|
||||
}
|
||||
|
||||
func GetMemInfo() (*mem.VirtualMemoryStat, error) {
|
||||
return mem.VirtualMemory()
|
||||
}
|
||||
|
||||
func GetDiskPercent() (float64, error) {
|
||||
var err error
|
||||
parts, err := disk.Partitions(true)
|
||||
@@ -86,6 +90,17 @@ func GetDiskPercent() (float64, error) {
|
||||
return value, err
|
||||
}
|
||||
|
||||
func GetDiskInfo() (*disk.UsageStat, error) {
|
||||
parts, err := disk.Partitions(true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(parts) == 0 {
|
||||
return nil, errors.New("disk partition not found")
|
||||
}
|
||||
return disk.Usage(parts[0].Mountpoint)
|
||||
}
|
||||
|
||||
func VerifyPort(port string) error {
|
||||
if port != "" {
|
||||
value, err := strconv.ParseInt(port, 10, 64)
|
||||
|
||||
Reference in New Issue
Block a user