udevevent

package
v1.8.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSubscription = errors.New("invailid subscription")

Functions

func Monitor

func Monitor() <-chan error

Monitor start monitoring on udev source

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

Jump to

Keyboard shortcuts

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