hwcontrol

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CDROM_SET_SPEED      = 0x5322 // ioctl command for setting speed
	CDROM_PROC_FILE_INFO = "/proc/sys/dev/cdrom/info"
)
View Source
const (
	EventAdd    = "add"
	EventChange = "change"
	EventRemove = "remove"
)

Variables

This section is empty.

Functions

func SetDiscSpeed

func SetDiscSpeed(device string, speed int) error

func StartMonitor

func StartMonitor(ctx context.Context, handlers []*EventHandler) error

Types

type EventHandler

type EventHandler struct {
	// contains filtered or unexported fields
}

func NewBasicDiscHandlers

func NewBasicDiscHandlers() []*EventHandler

NewBasicDiscHandlers initializes two event handlers for "add" and "remove" disc events.

func NewBasicUSBHandlers

func NewBasicUSBHandlers() []*EventHandler

func (*EventHandler) DeviceFilter

func (h *EventHandler) DeviceFilter(device *udev.Device) bool

func (*EventHandler) Name

func (h *EventHandler) Name() string

func (*EventHandler) Process

func (h *EventHandler) Process(ctx context.Context, device *udev.Device) error

func (*EventHandler) SetProcessor

func (h *EventHandler) SetProcessor(wg *sync.WaitGroup, actionLog string, processor func(device *udev.Device) error, notifier *notifications.Notifier, event string)

func (*EventHandler) StartSubscriber

func (h *EventHandler) StartSubscriber(wg *sync.WaitGroup, ctx context.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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