Documentation ¶
Index ¶
- Variables
- func RegisterManager(manager Manager)
- type Attribute
- type AttributeParser
- type DiskIdentify
- type DiskInfo
- type DiskParser
- type Event
- type EventType
- type IDiskAttribute
- type IPartition
- type IRaid
- type ISmart
- type Manager
- type PartitionInfo
- type PartitionParser
- type RaidInfo
- type RaidParser
- type SmartInfo
- type SmartInfoParser
Constants ¶
This section is empty.
Variables ¶
View Source
var RegisterManages = make(chan interface{}, 1)
RegisterManages
Functions ¶
Types ¶
type Attribute ¶
type Attribute struct { // DevicePath 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 Bus string `json:"id_bus,omitempty"` // FS_TYPE FSType string `json:"id_fs_type,omitempty"` // Model Model string `json:"id_model,omitempty"` // WWN WWN string `json:"id_wwn,omitempty"` // PartTableType PartTableType string `json:"id_part_table_type,omitempty"` // Serial Serial string `json:"id_serial,omitempty"` // Vendor Vendor string `json:"id_vendor,omitempty"` // ID_TYPE IDType string `json:"id_type"` // Capacity of the disk in bytes Capacity int64 `json:"capacity,omitempty"` // DriverType such as HDD, SSD DriverType string `json:"driverType"` // DEVLINKS DevLinks []string `json:"devLinks"` }
Attribute for disk details
type DiskIdentify ¶
type DiskIdentify struct { // DevPath such as /sys/devices/pci0000:00/0000:00:15.0/0000:03:00.0/host0/target0:0:1/0:0:1:0/block/sda DevPath string `json:"devPath"` // DevName such as /dev/sda DevName string `json:"devName"` // Name such as sda Name string `json:"name"` }
DiskIdentify
func NewDiskIdentifyWithName ¶
func NewDiskIdentifyWithName(devPath, devName string) *DiskIdentify
type DiskInfo ¶
type DiskInfo struct { // DiskIdentify DiskIdentify `json:"diskIdentify,omitempty"` // Attribute Attribute Attribute `json:"attribute,omitempty"` // Partition Partitions []PartitionInfo `json:"partition,omitempty"` // Raid Raid RaidInfo `json:"raid,omitempty"` // Smart Smart SmartInfo `json:"smart"` }
DiskInfo
func (DiskInfo) GenerateUUID ¶
GenerateUUID generates a UUID for the disk If the serial number exists, it is used first. If it does not exist, it is generated using by-path path
type DiskParser ¶
type DiskParser struct { // DiskIdentify *DiskIdentify *PartitionParser *RaidParser *AttributeParser *SmartInfoParser }
DiskParser The information source of the disk may use a variety of methods. For localDisk, it only focuses on the basic information of the disk itself. Therefore, there is no direct binding between the disk attributes and the specific implementation. The parser will be responsible for docking with various tools to output fixed information
func NewDiskParser ¶
func NewDiskParser( disk *DiskIdentify, partitionParser *PartitionParser, raidParser *RaidParser, attrParser *AttributeParser, smartParser *SmartInfoParser, ) *DiskParser
NewDiskParser
type IPartition ¶
type IPartition interface { HasPartition() bool ParsePartitionInfo() []PartitionInfo }
IPartition
type Manager ¶
type Manager interface { // ListExist list all disks exist on node ListExist() []Event // Monitor monitor all disk events(e.g. add/remove/offline) Monitor(chan Event) // StartTimerTrigger periodic trigger event StartTimerTrigger(chan Event) }
Manager for disk monitor
type PartitionInfo ¶
type PartitionInfo struct { // Name Name string // Size Size uint64 // Label Label string // Filesystem Filesystem string // Path Path string }
PartitionInfo
type RaidParser ¶
type RaidParser struct { // DiskIdentify Uniquely identify a disk DiskIdentify IRaid }
Raid
type SmartInfoParser ¶
type SmartInfoParser struct {
ISmart
}
Click to show internal directories.
Click to hide internal directories.