disk.go 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * @Author: LinkLeong link@icewhale.com
  3. * @Date: 2022-07-13 10:43:45
  4. * @LastEditors: LinkLeong
  5. * @LastEditTime: 2022-08-03 14:45:35
  6. * @FilePath: /CasaOS/model/disk.go
  7. * @Description:
  8. * @Website: https://www.casaos.io
  9. * Copyright (c) 2022 by icewhale, All Rights Reserved.
  10. */
  11. package model
  12. type LSBLKModel struct {
  13. Name string `json:"name"`
  14. FsType string `json:"fstype"`
  15. Size uint64 `json:"size"`
  16. FSSize string `json:"fssize"`
  17. Path string `json:"path"`
  18. Model string `json:"model"` //设备标识符
  19. RM bool `json:"rm"` //是否为可移动设备
  20. RO bool `json:"ro"` //是否为只读设备
  21. State string `json:"state"`
  22. PhySec int `json:"phy-sec"` //物理扇区大小
  23. Type string `json:"type"`
  24. Vendor string `json:"vendor"` //供应商
  25. Rev string `json:"rev"` //修订版本
  26. FSAvail string `json:"fsavail"` //可用空间
  27. FSUse string `json:"fsuse%"` //已用百分比
  28. MountPoint string `json:"mountpoint"`
  29. Format string `json:"format"`
  30. Health string `json:"health"`
  31. HotPlug bool `json:"hotplug"`
  32. UUID string `json:"uuid"`
  33. FSUsed string `json:"fsused"`
  34. Temperature int `json:"temperature"`
  35. Tran string `json:"tran"`
  36. MinIO uint64 `json:"min-io"`
  37. UsedPercent float64 `json:"used_percent"`
  38. Serial string `json:"serial"`
  39. Children []LSBLKModel `json:"children"`
  40. SubSystems string `json:"subsystems"`
  41. Label string `json:"label"`
  42. //详情特有
  43. StartSector uint64 `json:"start_sector,omitempty"`
  44. Rota bool `json:"rota"` //true(hhd) false(ssd)
  45. DiskType string `json:"disk_type"`
  46. EndSector uint64 `json:"end_sector,omitempty"`
  47. }
  48. type Drive struct {
  49. Name string `json:"name"`
  50. Size uint64 `json:"size"`
  51. Model string `json:"model"`
  52. Health string `json:"health"`
  53. Temperature int `json:"temperature"`
  54. DiskType string `json:"disk_type"`
  55. NeedFormat bool `json:"need_format"`
  56. Serial string `json:"serial"`
  57. Path string `json:"path"`
  58. ChildrenNumber int `json:"children_number"`
  59. }
  60. type DriveUSB struct {
  61. Name string `json:"name"`
  62. Size uint64 `json:"size"`
  63. Model string `json:"model"`
  64. Avail uint64 `json:"avail"`
  65. Children []USBChildren `json:"children"`
  66. }
  67. type USBChildren struct {
  68. Name string `json:"name"`
  69. Size uint64 `json:"size"`
  70. Avail uint64 `json:"avail"`
  71. MountPoint string `json:"mount_point"`
  72. }
  73. type Storage struct {
  74. MountPoint string `json:"mount_point"`
  75. Size string `json:"size"`
  76. Avail string `json:"avail"` //可用空间
  77. Type string `json:"type"`
  78. Path string `json:"path"`
  79. DriveName string `json:"drive_name"`
  80. Label string `json:"label"`
  81. }
  82. type Storages struct {
  83. DiskName string `json:"disk_name"`
  84. Size uint64 `json:"size"`
  85. Path string `json:"path"`
  86. Children []Storage `json:"children"`
  87. }
  88. type Summary struct {
  89. Size uint64 `json:"size"`
  90. Avail uint64 `json:"avail"` //可用空间
  91. Health bool `json:"health"`
  92. Used uint64 `json:"used"`
  93. }