udev

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 10 Imported by: 3

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 filter out disks that are virtual or can't identify themselves

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

	// 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
	DevLinks []string `json:"devLinks"`
}

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]interface{}, error)

Info

func (*Device) ParseDeviceInfo

func (d *Device) ParseDeviceInfo() error

ParseDeviceInfo

type DiskManager

type DiskManager struct {
}

DiskManager monitor disk by udev

func NewDiskManager

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

func (DiskManager) StartTimerTrigger added in v0.8.0

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

StartTimerTrigger trigger disk event

Jump to

Keyboard shortcuts

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