events

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const (
	ActionAdd    Action = "add"
	ActionRemove Action = "remove"
	ActionChange Action = "change"
)

type DeviceEvent

type DeviceEvent struct {
	Action       Action
	Kind         Kind
	DeviceID     string            // e.g. "1-2" for USB bus 1 dev 2
	Vendor       string            // Vendor name or ID
	Product      string            // Product name or ID
	Serial       string            // Serial number if available
	Capabilities string            // Human-readable capability description
	Raw          map[string]string // Raw properties for extensibility
}

func (*DeviceEvent) FormatMessage

func (e *DeviceEvent) FormatMessage() string

type EventSource

type EventSource interface {
	Kind() Kind
	Start(ctx context.Context) (<-chan *DeviceEvent, error)
	Stop() error
}

type Kind

type Kind string
const (
	KindUSB       Kind = "usb"
	KindBluetooth Kind = "bluetooth"
	KindPCI       Kind = "pci"
	KindGeneric   Kind = "generic"
)

Jump to

Keyboard shortcuts

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