Documentation
¶
Index ¶
- func GenerateDiskGUID(disk *Disk, nodeName string) string
- func GeneratePartitionGUID(part *Partition, nodeName string) string
- func GetDevPathByPTUUID(ptUUID string) (string, error)
- func GetDiskUUID(part string, uuidType string) string
- func GetFileSystemLabel(devPath string) string
- func GetFileSystemType(part string) string
- func GetParentDevName(devPath string) (string, error)
- func GetPartType(devPath string) string
- 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 GetDevPathByPTUUID ¶ added in v0.4.1
func GetDiskUUID ¶
func GetFileSystemLabel ¶ added in v0.2.0
func GetFileSystemType ¶
func GetParentDevName ¶
func GetPartType ¶ added in v0.3.1
func HasPartitions ¶
Types ¶
type Disk ¶
type Disk struct {
Name string `json:"name"`
Label string `json:"label"`
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
FsUUID string `json:"fs_uuid"` // This would be filesystem UUID on macOS and linux, empty on Windows
PartType string `json:"part_type"`
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.