Documentation ¶
Index ¶
- func GenerateDiskGUID(disk *Disk) string
- func GeneratePartitionGUID(part *Partition) string
- func GetDiskUUID(part string, uuidType string) string
- func GetFileSystemType(part string) string
- func GetParentDevName(devPath string) (string, error)
- func HasPartitions(disk *Disk) bool
- type Disk
- type FileSystemInfo
- type Info
- type Partition
- type UUIDType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDiskGUID ¶
GenerateDiskGUID generates a GUID for disks.
func GeneratePartitionGUID ¶
GeneratePartitionGUID generates a GUID for partitions.
func GetDiskUUID ¶
func GetFileSystemType ¶
func GetParentDevName ¶
func HasPartitions ¶
Types ¶
type Disk ¶
type Disk struct { Name string `json:"name"` SizeBytes uint64 `json:"size_bytes"` PhysicalBlockSizeBytes uint64 `json:"physical_block_size_bytes"` DriveType block.DriveType `json:"drive_type"` IsRemovable bool `json:"removable"` StorageController block.StorageController `json:"storage_controller"` UUID string `json:"uuid"` // This would be volume UUID on macOS, UUID on linux, empty on Windows PtUUID string `json:"pt_uuid"` // This would be volume PtUUID on macOS, PartUUID on linux, empty on Windows BusPath string `json:"bus_path"` FileSystemInfo FileSystemInfo `json:"file_system_info"` NUMANodeID int `json:"numa_node_id"` Vendor string `json:"vendor"` Model string `json:"model"` SerialNumber string `json:"serial_number"` WWN string `json:"wwn"` Partitions []*Partition `json:"partitions"` }
Disk describes a single disk drive on the host system. Disk drives provide raw block storage resources.
type FileSystemInfo ¶
type Info ¶
type Info interface { GetDisks() []*Disk GetPartitions() []*Partition GetDiskByDevPath(name string) *Disk GetPartitionByDevPath(disk, part string) *Partition GetFileSystemInfoByDevPath(dname string) *FileSystemInfo }
Info describes all disk drives and partitions in the host system.
type Partition ¶
type Partition struct { Disk *Disk `json:"-"` Name string `json:"name"` Label string `json:"label"` SizeBytes uint64 `json:"size_bytes"` UUID string `json:"uuid"` // This would be volume UUID on macOS, PartUUID on linux, empty on Windows DriveType block.DriveType `json:"drive_type"` StorageController block.StorageController `json:"storage_controller"` FileSystemInfo FileSystemInfo `json:"file_system_info"` }
Partition describes a logical division of a Disk.
Click to show internal directories.
Click to hide internal directories.