typedef.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package smart
  2. type SATADiskInfo struct {
  3. ModelFamily string
  4. DeviceModel string
  5. SerialNumber string
  6. Firmware string
  7. UserCapacity string
  8. SectorSize string
  9. RotationRate string
  10. FormFactor string
  11. SmartSupport bool
  12. }
  13. type NVMEInfo struct {
  14. ModelNumber string
  15. SerialNumber string
  16. FirmwareVersion string
  17. PCIVendorSubsystemID string
  18. IEEEOUIIdentifier string
  19. TotalNVMeCapacity string
  20. UnallocatedNVMeCapacity string
  21. ControllerID string
  22. NVMeVersion string
  23. NumberOfNamespaces string
  24. NamespaceSizeCapacity string
  25. NamespaceUtilization string
  26. NamespaceFormattedLBASize string
  27. NamespaceIEEE_EUI_64 string
  28. }
  29. type DiskType int
  30. const (
  31. DiskType_Unknown DiskType = iota
  32. DiskType_NVMe
  33. DiskType_SATA
  34. )
  35. type SMARTTestResult struct {
  36. TestResult string
  37. MarginalAttributes []SMARTAttribute
  38. }
  39. type SMARTAttribute struct {
  40. ID int
  41. Name string
  42. Flag string
  43. Value int
  44. Worst int
  45. Threshold int
  46. Type string
  47. Updated string
  48. WhenFailed string
  49. RawValue string
  50. }
  51. type DriveHealthInfo struct {
  52. DeviceName string // e.g., sda
  53. DeviceModel string
  54. SerialNumber string
  55. PowerOnHours uint64
  56. PowerCycleCount uint64
  57. ReallocatedSectors uint64 // HDD
  58. ReallocateNANDBlocks uint64 // SSD
  59. WearLevelingCount uint64 // SSD/NVMe
  60. UncorrectableErrors uint64
  61. PendingSectors uint64 // HDD
  62. ECCRecovered uint64
  63. UDMACRCErrors uint64
  64. TotalLBAWritten uint64
  65. TotalLBARead uint64
  66. IsSSD bool
  67. IsNVMe bool
  68. IsHealthy bool //true if the test Passed
  69. }