Documentation ¶
Overview ¶
Package hotplug provides for cross-platform discovery of connected devices.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Path string Class DeviceClass // contains filtered or unexported fields }
func (*Device) Address ¶
Address is the address of the device on its bus.
The interpretation of the address depends on the bus.
func (*Device) BusNumber ¶
BusNumber is a number distinguishing the bus the device is connected to from other busses of the same type on the computer.
The bus numbering scheme is bus-specific.
type DeviceClass ¶
type DeviceClass uint
const ( DevUnknown DeviceClass = iota DevHid DevUsbDevice DevUsbInterface )
type DeviceInterface ¶
type DeviceInterface struct { Path string Class InterfaceClass Device *Device // contains filtered or unexported fields }
A DeviceInterface describes a particular way to interact with a Device.
func (*DeviceInterface) OnDetach ¶
func (devIf *DeviceInterface) OnDetach(callback func()) error
type InterfaceClass ¶
type InterfaceClass uint
const ( DevIfUnknown InterfaceClass = iota DevIfHid DevIfPrinter )
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func New ¶
func New( class InterfaceClass, callback ListenerCallback, ) (*Listener, error)
func (*Listener) Enumerate ¶
Enumerate calls the ArriveCallback for each device present in the system.
type ListenerCallback ¶
type ListenerCallback func(iface *DeviceInterface)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.