| 1 | package main |
| 2 | |
| 3 | type RadNodeInfo struct { |
| 4 | ID string `json:"id"` |
| 5 | Agent string `json:"agent"` |
| 6 | State string `json:"state"` |
| 7 | Config struct { |
| 8 | SeedingPolicy struct { |
| 9 | Default string `json:"default"` |
| 10 | } `json:"seedingPolicy"` |
| 11 | } `json:"config"` |
| 12 | } |
| 13 | |
| 14 | type RadNodeRepos struct { |
| 15 | Repos struct { |
| 16 | Total int `json:"total"` |
| 17 | } `json:"repos"` |
| 18 | } |
| 19 | |
| 20 | type SystemStats struct { |
| 21 | CPUUsage float64 `json:"cpuUsage"` |
| 22 | MemoryUsed uint64 `json:"memoryUsed"` |
| 23 | MemoryTotal uint64 `json:"memoryTotal"` |
| 24 | OS string `json:"os"` |
| 25 | Kernel string `json:"kernel"` |
| 26 | Uptime string `json:"uptime"` |
| 27 | CPUModel string `json:"cpuModel"` |
| 28 | } |
| 29 | |
| 30 | type IPFSRepoStats struct { |
| 31 | RepoSize int64 `json:"RepoSize"` |
| 32 | StorageMax int64 `json:"StorageMax"` |
| 33 | NumObjects int `json:"NumObjects"` |
| 34 | RepoPath string `json:"RepoPath"` |
| 35 | Version string `json:"Version"` |
| 36 | } |
| 37 | |
| 38 | type BandwidthStats struct { |
| 39 | RateIn float64 `json:"RateIn"` |
| 40 | RateOut float64 `json:"RateOut"` |
| 41 | TotalIn int64 `json:"TotalIn"` |
| 42 | TotalOut int64 `json:"TotalOut"` |
| 43 | } |
| 44 | |
| 45 | type CombinedStats struct { |
| 46 | IPFSRepoStats |
| 47 | BandwidthStats |
| 48 | SystemStats |
| 49 | RadNodeInfo |
| 50 | RadNodeRepos |
| 51 | } |