udev

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UdevSystem is used to filter devices other than disk which udev tracks (eg. CD ROM)
	UdevSystem = "disk"
	// UDevPartition is used to filter out partitions
	UdevPartition = "partition"
	// LinkNameIndex is used to get link index from dev link
	LinkNameIndex = 2

	UdevDevname       = "DEVNAME"
	UdevDevtype       = "DEVTYPE"
	UdevFsUUID        = "ID_FS_UUID"
	UdevIDPath        = "ID_PATH"
	UdevModel         = "ID_MODEL"
	UdevPartEntryType = "ID_PART_ENTRY_TYPE"
	UdevPartEntryUUID = "ID_PART_ENTRY_UUID"
	UdevPartTableType = "ID_PART_TABLE_TYPE"
	UdevPartTableUUID = "ID_PART_TABLE_UUID"
	UdevSerialNumber  = "ID_SERIAL"
	UdevType          = "ID_TYPE"
	UdevVendor        = "ID_VENDOR"
	UdevWWN           = "ID_WWN"
)

key and env of udev uevent.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device map[string]string

func InitUdevDevice

func InitUdevDevice(udev map[string]string) Device

func (Device) GetDevName

func (device Device) GetDevName() string

GetDevName returns the path of device in /dev directory

func (Device) GetDevType

func (device Device) GetDevType() string

func (Device) GetIDPath

func (device Device) GetIDPath() string

GetIDPath returns the device id path

func (Device) GetIDType

func (device Device) GetIDType() string

func (Device) GetShortName

func (device Device) GetShortName() string

GetShortName returns the short device name of the /dev directory, e.g /dev/sda will return the name sda

func (Device) IsDisk

func (device Device) IsDisk() bool

IsDisk check if device is a disk

func (Device) IsPartition

func (device Device) IsPartition() bool

IsPartition check if device is a partition

type Udev

type Udev struct {
	// contains filtered or unexported fields
}

func NewUdev

func NewUdev(opt *option.Option, scanner *blockdevice.Scanner) *Udev

func (*Udev) ActionHandler

func (u *Udev) ActionHandler(uevent netlink.UEvent)

func (*Udev) AddBlockDevice

func (u *Udev) AddBlockDevice(device *v1beta1.BlockDevice, autoProvisioned bool)

AddBlockDevice add new block device and partitions by watching the udev add action

func (*Udev) Monitor

func (u *Udev) Monitor(ctx context.Context)

Jump to

Keyboard shortcuts

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