Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSubscription = errors.New("invailid subscription")
Functions ¶
func Unsubscribe ¶ added in v1.6.1
func Unsubscribe(sub *Subscription) error
Usubscribe from an active subscription
Types ¶
type Subscription ¶ added in v1.6.1
type Subscription struct {
// contains filtered or unexported fields
}
Subscription is used to receive events from udev
func Subscribe ¶ added in v1.6.1
func Subscribe(eventTypes ...UdevEventType) *Subscription
Subscribe to udev events. Optionally pass eventTypes to filter the events based on their type
func (*Subscription) Events ¶ added in v1.6.1
func (s *Subscription) Events() <-chan UdevEvent
type UdevEvent ¶ added in v1.6.1
type UdevEvent struct { *libudevwrapper.UdevDevice // contains filtered or unexported fields }
UdevEvent is a wrapper for an event received from udev
func (UdevEvent) GetAction ¶ added in v1.6.1
func (u UdevEvent) GetAction() UdevEventType
func (UdevEvent) GetType ¶ added in v1.6.1
func (u UdevEvent) GetType() UdevEventType
type UdevEventType ¶ added in v1.6.1
type UdevEventType uint
const ( EventTypeAdd UdevEventType = iota EventTypeRemove EventTypeChange )
func (UdevEventType) String ¶ added in v1.6.1
func (uevt UdevEventType) String() string
Click to show internal directories.
Click to hide internal directories.