31 lines
538 B
Go
31 lines
538 B
Go
package system
|
|
|
|
import "context"
|
|
|
|
type ServerDiskInfo struct {
|
|
MountPoint string
|
|
UsedMB uint64
|
|
UsedGB uint64
|
|
TotalMB uint64
|
|
TotalGB uint64
|
|
UsedPercent int
|
|
}
|
|
|
|
type ServerInfo struct {
|
|
GOOS string
|
|
NumCPU int
|
|
Compiler string
|
|
GoVersion string
|
|
NumGoroutine int
|
|
CPUs []float64
|
|
Cores int
|
|
UsedMB uint64
|
|
TotalMB uint64
|
|
UsedPercent int
|
|
Disk []ServerDiskInfo
|
|
}
|
|
|
|
type SystemInfoProvider interface {
|
|
Collect(context.Context, []string) (*ServerInfo, error)
|
|
}
|