udevmonitor

package
v0.0.0-...-9e584df Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceAddedFunc

type DeviceAddedFunc func(device *hotplug.HotplugDeviceInfo)

type DeviceRemovedFunc

type DeviceRemovedFunc func(device *hotplug.HotplugDeviceInfo)

type EnumerationDoneFunc

type EnumerationDoneFunc func()

type Interface

type Interface interface {
	Connect() error
	Run() error
	Stop() error
}

func New

func New(added DeviceAddedFunc, removed DeviceRemovedFunc, enumerationDone EnumerationDoneFunc) Interface

type Monitor

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

Monitor monitors kernel uevents making it possible to find hotpluggable devices.

func (*Monitor) Connect

func (m *Monitor) Connect() error

func (*Monitor) EventsChannel

func (m *Monitor) EventsChannel() chan netlink.UEvent

func (*Monitor) Run

func (m *Monitor) Run() error

Run enumerates existing USB devices and starts a new goroutine that handles hotplug events (devices added or removed). It returns immediately. The goroutine must be stopped by calling Stop() method.

func (*Monitor) Stop

func (m *Monitor) Stop() error

Jump to

Keyboard shortcuts

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