events

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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