godash/services/system.types.go

56 lines
1.1 KiB
Go
Raw Normal View History

2024-03-12 15:49:08 +01:00
package services
2023-06-14 21:53:27 +02:00
2024-03-12 15:49:08 +01:00
import "github.com/r3labs/sse/v2"
2023-06-14 21:53:27 +02:00
2024-03-12 15:49:08 +01:00
type SystemService struct {
2023-06-14 21:53:27 +02:00
sse *sse.Server
Live LiveInformation `json:"live"`
Static StaticInformation `json:"static"`
}
type LiveStorageInformation struct {
Value string `json:"value"`
Percentage float64 `json:"percentage"`
}
type LiveInformation struct {
CPU float64 `json:"cpu"`
Ram LiveStorageInformation `json:"ram"`
Disk LiveStorageInformation `json:"disk"`
Uptime Uptime `json:"uptime"`
}
type Uptime struct {
Days uint64 `json:"days"`
Hours uint16 `json:"hours"`
Minutes uint16 `json:"minutes"`
Seconds uint16 `json:"seconds"`
Percentage float32 `json:"percentage"`
}
type CPU struct {
Name string `json:"name"`
Threads string `json:"threads"`
}
type Host struct {
Architecture string `json:"architecture"`
}
type Ram struct {
Total string `json:"total"`
Swap string `json:"swap"`
}
type Disk struct {
Total string `json:"total"`
Partitions string `json:"partitions"`
}
type StaticInformation struct {
CPU CPU `json:"cpu"`
Ram Ram `json:"ram"`
Disk Disk `json:"disk"`
Host Host `json:"host"`
}