Documentation
¶
Index ¶
- func Listen(ctx context.Context) (chan *Device, error)
- func ListenFiltered(ctx context.Context, filters ...Filter) (chan *Device, error)
- type ActionEvent
- type ActionFilter
- type Device
- func (d *Device) Action() string
- func (d *Device) Major() string
- func (d *Device) Minor() string
- func (d *Device) Path() string
- func (d *Device) ProductID() string
- func (d *Device) Properties() map[string]string
- func (d *Device) Serial() string
- func (d *Device) Vendor() string
- func (d *Device) VendorID() string
- type Filter
- type Monitor
- type PartitionFilter
- type SerialFilter
- type UdevMonitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionEvent ¶
type ActionEvent string
const ( ActionAdd ActionEvent = "add" ActionRemove ActionEvent = "remove" ActionAll ActionEvent = "all" )
type ActionFilter ¶
type ActionFilter struct {
Action ActionEvent
}
func (*ActionFilter) Matches ¶
func (f *ActionFilter) Matches(dev *Device) bool
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) Properties ¶
type PartitionFilter ¶
type PartitionFilter struct {
Serial string
}
func (*PartitionFilter) Matches ¶
func (f *PartitionFilter) Matches(dev *Device) bool
type SerialFilter ¶
type SerialFilter struct {
Serial string
}
func (*SerialFilter) Matches ¶
func (f *SerialFilter) Matches(dev *Device) bool
type UdevMonitor ¶
type UdevMonitor struct {
// contains filtered or unexported fields
}
func NewUdevMonitor ¶
func NewUdevMonitor() *UdevMonitor
func (*UdevMonitor) DeviceChan ¶
Click to show internal directories.
Click to hide internal directories.