structs.go 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. package structs
  2. import (
  3. "time"
  4. )
  5. type WsPayload struct {
  6. Type string `json:"type"`
  7. Action string `json:"action"`
  8. }
  9. type SessionInfo struct {
  10. Hash string `json:"hash"`
  11. Created string `json:"created"`
  12. }
  13. type SysConfig struct {
  14. Setup string `json:"setup"`
  15. EndpointUrl string `json:"endpointUrl"`
  16. ApiVersion string `json:"apiVersion"`
  17. Piers []string `json:"piers"`
  18. NetCheck string `json:"netCheck"`
  19. UpdateMode string `json:"updateMode"`
  20. UpdateUrl string `json:"updateUrl"`
  21. UpdateBranch string `json:"updateBranch"`
  22. SwapVal int `json:"swapVal"`
  23. SwapFile string `json:"swapFile"`
  24. KeyFile string `json:"keyFile"`
  25. Sessions struct {
  26. Authorized map[string]SessionInfo `json:"authorized"`
  27. Unauthorized map[string]SessionInfo `json:"unauthorized"`
  28. } `json:"sessions"`
  29. LinuxUpdates struct {
  30. Value int `json:"value"`
  31. Interval string `json:"interval"`
  32. Previous bool `json:"previous"`
  33. } `json:"linuxUpdates"`
  34. DockerData string `json:"dockerData"`
  35. WgOn bool `json:"wgOn"`
  36. WgRegistered bool `json:"wgRegistered"`
  37. PwHash string `json:"pwHash"`
  38. C2cInterval int `json:"c2cInterval"`
  39. FirstBoot bool `json:"firstBoot"`
  40. WgRegisterd bool `json:"wgRegisterd"`
  41. GsVersion string `json:"gsVersion"`
  42. CfgDir string `json:"CFG_DIR"`
  43. UpdateInterval int `json:"updateInterval"`
  44. BinHash string `json:"binHash"`
  45. Pubkey string `json:"pubkey"`
  46. Privkey string `json:"privkey"`
  47. Salt string `json:"salt"`
  48. }
  49. type LoginStatus struct {
  50. Locked bool
  51. End time.Time
  52. Attempts int
  53. }
  54. type LoginKeys struct {
  55. Old struct {
  56. Pub string
  57. Priv string
  58. }
  59. Cur struct {
  60. Pub string
  61. Priv string
  62. }
  63. }
  64. type Version struct {
  65. Groundseg struct {
  66. Canary Channel `json:"canary"`
  67. Edge Channel `json:"edge"`
  68. Latest Channel `json:"latest"`
  69. } `json:"groundseg"`
  70. }
  71. type Channel struct {
  72. Groundseg VersionDetails `json:"groundseg"`
  73. Manual VersionDetails `json:"manual"`
  74. Minio VersionDetails `json:"minio"`
  75. Miniomc VersionDetails `json:"miniomc"`
  76. Netdata VersionDetails `json:"netdata"`
  77. Vere VersionDetails `json:"vere"`
  78. Webui VersionDetails `json:"webui"`
  79. Wireguard VersionDetails `json:"wireguard"`
  80. }
  81. type VersionDetails struct {
  82. Amd64Sha256 string `json:"amd64_sha256"`
  83. Amd64URL string `json:"amd64_url,omitempty"`
  84. Arm64Sha256 string `json:"arm64_sha256"`
  85. Arm64URL string `json:"arm64_url,omitempty"`
  86. Major int `json:"major,omitempty"`
  87. Minor int `json:"minor,omitempty"`
  88. Patch int `json:"patch,omitempty"`
  89. Repo string `json:"repo,omitempty"`
  90. Tag string `json:"tag,omitempty"`
  91. }
  92. type SystemUsage struct {
  93. RAM []int64 `json:"ram"`
  94. CPU int `json:"cpu"`
  95. CPUTemp int `json:"cpu_temp"`
  96. Disk []int64 `json:"disk"`
  97. SwapFile int `json:"swap"`
  98. }
  99. type SystemUpdates struct {
  100. Linux struct {
  101. State string `json:"state"`
  102. Upgrade int `json:"upgrade"`
  103. New int `json:"new"`
  104. Remove int `json:"remove"`
  105. Ignore int `json:"ignore"`
  106. } `json:"linux"`
  107. }
  108. type SystemWifi struct {
  109. Status string `json:"status"`
  110. Active string `json:"active"`
  111. Networks []string `json:"networks"`
  112. }
  113. type SystemInfo struct {
  114. Usage SystemUsage `json:"usage"`
  115. Updates SystemUpdates `json:"updates"`
  116. Wifi SystemWifi `json:"wifi"`
  117. }
  118. type Profile struct {
  119. Startram Startram `json:"startram"`
  120. }
  121. type Startram struct {
  122. Info struct {
  123. Registered bool `json:"registered"`
  124. Running bool `json:"running"`
  125. Region any `json:"region"`
  126. Expiry any `json:"expiry"`
  127. Renew bool `json:"renew"`
  128. Endpoint string `json:"endpoint"`
  129. Regions map[string]StartramRegion `json:"regions"`
  130. } `json:"info"`
  131. Transition struct {
  132. Register any `json:"register"`
  133. Toggle any `json:"toggle"`
  134. } `json:"transition"`
  135. }
  136. type Urbit struct {
  137. Info struct {
  138. Network string `json:"network"`
  139. Running bool `json:"running"`
  140. URL string `json:"url"`
  141. UrbAlias bool `json:"urbAlias"`
  142. MemUsage uint64 `json:"memUsage"`
  143. DiskUsage int64 `json:"diskUsage"`
  144. LoomSize int `json:"loomSize"`
  145. DevMode bool `json:"devMode"`
  146. DetectBootStatus bool `json:"detectBootStatus"`
  147. Remote bool `json:"remote"`
  148. Vere any `json:"vere"`
  149. } `json:"info"`
  150. Transition struct {
  151. Meld any `json:"meld"`
  152. ServiceRegistrationStatus string `json:"serviceRegistrationStatus"`
  153. TogglePower any `json:"togglePower"`
  154. DeleteShip any `json:"deleteShip"`
  155. } `json:"transition"`
  156. }
  157. type Logs struct {
  158. Containers struct {
  159. Wireguard struct {
  160. Logs []any `json:"logs"`
  161. } `json:"wireguard"`
  162. } `json:"containers"`
  163. System struct {
  164. Stream bool `json:"stream"`
  165. Logs []any `json:"logs"`
  166. } `json:"system"`
  167. }
  168. type AuthBroadcast struct {
  169. Type string `json:"type"`
  170. AuthLevel string `json:"auth_level"`
  171. Upload Upload `json:"upload"`
  172. Logs Logs `json:"logs"`
  173. System SystemInfo `json:"system"`
  174. Profile Profile `json:"profile"`
  175. Urbits map[string]Urbit `json:"urbits"`
  176. }
  177. type Upload struct {
  178. Status string `json:"status"`
  179. Size int `json:"size"`
  180. Uploaded int `json:"uploaded"`
  181. Patp any `json:"patp"`
  182. }
  183. type UnauthBroadcast struct {
  184. Type string `json:"type"`
  185. AuthLevel string `json:"auth_level"`
  186. Login struct {
  187. Remainder int `json:"remainder"`
  188. } `json:"login"`
  189. }
  190. type SetupBroadcast struct {
  191. Type string `json:"type"`
  192. AuthLevel string `json:"auth_level"`
  193. Stage string `json:"stage"`
  194. Page string `json:"page"`
  195. Regions map[string]StartramRegion `json:"regions"`
  196. }
  197. type StartramRegion struct {
  198. Country string `json:"country"`
  199. Desc string `json:"desc"`
  200. }
  201. type UrbitDocker struct {
  202. PierName string `json:"pier_name"`
  203. HTTPPort int `json:"http_port"`
  204. AmesPort int `json:"ames_port"`
  205. LoomSize int `json:"loom_size"`
  206. UrbitVersion string `json:"urbit_version"`
  207. MinioVersion string `json:"minio_version"`
  208. UrbitRepo string `json:"urbit_repo"`
  209. MinioRepo string `json:"minio_repo"`
  210. UrbitAmd64Sha256 string `json:"urbit_amd64_sha256"`
  211. UrbitArm64Sha256 string `json:"urbit_arm64_sha256"`
  212. MinioAmd64Sha256 string `json:"minio_amd64_sha256"`
  213. MinioArm64Sha256 string `json:"minio_arm64_sha256"`
  214. MinioPassword string `json:"minio_password"`
  215. Network string `json:"network"`
  216. WgURL string `json:"wg_url"`
  217. WgHTTPPort int `json:"wg_http_port"`
  218. WgAmesPort int `json:"wg_ames_port"`
  219. WgS3Port int `json:"wg_s3_port"`
  220. WgConsolePort int `json:"wg_console_port"`
  221. MeldSchedule bool `json:"meld_schedule"`
  222. MeldFrequency int `json:"meld_frequency"`
  223. MeldTime string `json:"meld_time"`
  224. MeldLast string `json:"meld_last"`
  225. MeldNext string `json:"meld_next"`
  226. BootStatus string `json:"boot_status"`
  227. CustomUrbitWeb string `json:"custom_urbit_web"`
  228. CustomS3Web string `json:"custom_s3_web"`
  229. ShowUrbitWeb string `json:"show_urbit_web"`
  230. DevMode bool `json:"dev_mode"`
  231. Click bool `json:"click"`
  232. }
  233. type ContainerStats struct {
  234. MemoryUsage uint64
  235. DiskUsage int64
  236. }