pilebones / go-udev

Simple udev implementation in Golang
GNU General Public License v3.0
95 stars 28 forks source link

Expose Api for pure go code consumption #22

Closed GaikwadPratik closed 3 years ago

GaikwadPratik commented 3 years ago

Hi @pilebones ,

Is it possible to expose the api so we can use them directly from go code rather than using exec and then parsing the stdout

pilebones commented 3 years ago

Hi @GaikwadPratik,

Could you detail your needs for better understanding to my part ? The main.go file has been implement as example to showcase which kind of informations are gathered and when. But this project goals is to provide an API to retrieve some uevent using some "matchers" programmatically.

An example of usage is visible (but complex) in my own go-gpsd project (I use it to auto-detect a GPS device already plug or hot-plug on a system, see: https://github.com/pilebones/go-gpsd/blob/master/autodetect.go#L28).

Best,

GaikwadPratik commented 3 years ago

@pilebones ,

Thanks. I was looking for something similar.

Nice library :)