structs.go 7.5 KB

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