Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListAllBlockDevices ¶ added in v0.12.3
ListAllBlockDevices list all block devices by udev
Types ¶
type Device ¶
type Device struct { // DevPath represents the disk hardware path. // The general format is like /sys/devices/pci0000:ae/0000:ae:02.0/0000:b1:00.0/host2/target2:1:0/2:1:0:0/block/sdc/sdc DevPath string `json:"devPath,omitempty"` // DevName the general format is /dev/sda DevName string `json:"devName,omitempty"` // DevType such as disk, partition DevType string `json:"devType,omitempty"` // Major represents drive used by the device Major string `json:"major,omitempty"` // Minor is used to distinguish different devices Minor string `json:"minor,omitempty"` // SubSystem identifies the device's system type, such as block SubSystem string `json:"subSystem,omitempty"` // Bus represents the bus type of the device, such as USB, SATA Bus string `json:"id_bus,omitempty"` // FSType represents the filesystem type such as ext4, ntfs FSType string `json:"id_fs_type,omitempty"` // Model represents the specific model of the storage device, usually specified by the manufacturer Model string `json:"id_model,omitempty"` // WWN represents the World Wide Name(WWN) of the device. // The general format is like 5001b444a89e5acd. WWN string `json:"id_wwn,omitempty"` // PartTableType represents the partition table type, such as gpt or mbr PartTableType string `json:"id_part_table_type,omitempty"` // Serial represents the Serial Number(SN) of the device. // The general format is like 162061400553 Serial string `json:"id_serial,omitempty"` // Vendor represents the manufacturer of the device Vendor string `json:"id_vendor,omitempty"` // IDType specifies the detailed type of the device according to udev rules, such as 'cd', 'disk', or 'partition', // providing a finer classification than DevType, usually the values of IDType and DevType are the same IDType string `json:"id_type"` // PartName such as EFI System Partition PartName string `json:"partName"` // Name is the name of the device node sda, sdb, dm-0 etc Name string `json:"name"` // DevLinks is a symbolic link array for the device, containing all symbolic links for the device DevLinks []string `json:"devLinks"` }
func NewDeviceWithName ¶
func (*Device) FilterDisk ¶ added in v0.12.3
FilterDisk filter out disks that are virtual or can't identify themselves
func (*Device) ParseDeviceInfo ¶
func (*Device) ParseDiskAttribute ¶ added in v0.13.1
type DiskManager ¶
type DiskManager struct { }
DiskManager monitor disk by udev
func NewDiskManager ¶
func NewDiskManager() DiskManager
func (DiskManager) StartTimerTrigger ¶ added in v0.8.0
func (dm DiskManager) StartTimerTrigger(c chan manager.Event)
StartTimerTrigger trigger disk event
Click to show internal directories.
Click to hide internal directories.