Documentation
¶
Index ¶
- Constants
- func EncodeDeviceList(devices []DeviceInfo) []byte
- type Client
- func (c *Client) Close() error
- func (c *Client) GetDevice(devPath string) (DeviceInfo, error)
- func (c *Client) ListDevices() ([]DeviceInfo, error)
- func (c *Client) OnDeviceAdded(fn func(DeviceEvent))
- func (c *Client) OnDeviceChanged(fn func(DeviceEvent))
- func (c *Client) OnDeviceRemoved(fn func(DeviceEvent))
- func (c *Client) Raw() *sutra.Client
- func (c *Client) Trigger(subsystem string) error
- type DeviceEvent
- type DeviceInfo
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func EncodeDeviceList ¶
func EncodeDeviceList(devices []DeviceInfo) []byte
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a typed API to the uevent service.
func (*Client) ListDevices ¶
func (c *Client) ListDevices() ([]DeviceInfo, error)
func (*Client) OnDeviceAdded ¶
func (c *Client) OnDeviceAdded(fn func(DeviceEvent))
func (*Client) OnDeviceChanged ¶
func (c *Client) OnDeviceChanged(fn func(DeviceEvent))
func (*Client) OnDeviceRemoved ¶
func (c *Client) OnDeviceRemoved(fn func(DeviceEvent))
type DeviceEvent ¶
type DeviceEvent struct {
Action string
Subsystem string
DevPath string
DevName string
DevType string
Major int
Minor int
}
func DecodeDeviceEvent ¶
func DecodeDeviceEvent(data []byte) DeviceEvent
func (*DeviceEvent) Encode ¶
func (e *DeviceEvent) Encode() []byte
type DeviceInfo ¶
type DeviceInfo struct {
DevPath string
DevName string
Subsystem string
DevType string
Driver string
Major int
Minor int
}
func DecodeDeviceInfo ¶
func DecodeDeviceInfo(data []byte) DeviceInfo
func DecodeDeviceList ¶
func DecodeDeviceList(data []byte) []DeviceInfo
func (*DeviceInfo) Encode ¶
func (i *DeviceInfo) Encode() []byte
Click to show internal directories.
Click to hide internal directories.