udev

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRuleForBlock

func GenRuleForBlock() netlink.Matcher

GenRuleForBlock

Types

type CDevice

type CDevice struct {
	crawler.Device
}

CDevice alias of crawler.Device

func NewCDevice

func NewCDevice(device crawler.Device) CDevice

NewCDevice

func (CDevice) FilterDisk

func (d CDevice) FilterDisk() bool

FilterDisk

type Device

type Device 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"`

	// ID_PATH
	IDPath string `json:"id_path"`

	// 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"`
}

Device

func NewDevice

func NewDevice(devPath string) *Device

NewDevice

func NewDeviceWithName

func NewDeviceWithName(devPath, devName string) *Device

NewDeviceWithName

func (*Device) Info

func (d *Device) Info() (map[string]string, error)

Info

func (*Device) ParseDeviceInfo

func (d *Device) ParseDeviceInfo() error

ParseDeviceInfo

type DiskManager

type DiskManager struct {
}

DiskManager monitor disk by udev

func NewDiskManager added in v0.1.2

func NewDiskManager() DiskManager

func (DiskManager) ListExist

func (dm DiskManager) ListExist() []manager.Event

ListExist

func (DiskManager) Monitor

func (dm DiskManager) Monitor(c chan manager.Event)

Monitor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL