Documentation
¶
Index ¶
- Constants
- func FilterBluetoothName(name string) bool
- func FilterCameraName(name string) bool
- func FilterCardName(name string) bool
- func ProcGetByKey(filename, delim string, keySet map[string]string, fall bool) error
- func ReadFileContent(filename string) (string, error)
- func SHA256Sum(data []byte) string
- func ScanDir(dir string, filter func(string) bool) ([]string, error)
- type CardInfo
- type IDInfo
- type PCIUEvent
- type UEvent
- type UEventType
- type USBUEvent
Constants ¶
View Source
const ( // SlotTypePCI pci type slot SlotTypePCI = "pci" // SlotTypeUSB usb type slot SlotTypeUSB = "usb" )
Variables ¶
This section is empty.
Functions ¶
func FilterBluetoothName ¶
FilterBluetoothName filter bluetooth device name
func FilterCameraName ¶
FilterCameraName filter camera device name
func FilterCardName ¶
FilterCardName filter sound,graphic card name, such as 'card0'
func ProcGetByKey ¶
func ReadFileContent ¶
ReadFileContent get file content and trim the last newline
Types ¶
type CardInfo ¶
CardInfo store card info, such as: sound, graphic...
func NewCardInfo ¶
NewCardInfo create card info from uevent
type PCIUEvent ¶
type PCIUEvent struct { Driver string Vendor *IDInfo Device *IDInfo SVendor *IDInfo // subsystem vendor SDevice *IDInfo // subsystem device // contains filtered or unexported fields }
PCIUevent pci uevent data
type UEvent ¶
type UEvent struct { Type UEventType Name string Data interface{} }
UEvent store device uevent file
type UEventType ¶
type UEventType int
UEventType device port r=type
const ( // device with pci port UEventTypePCI UEventType = iota + 11 // device with usb port UEventTypeUSB )
Click to show internal directories.
Click to hide internal directories.