@@ -58,8 +58,9 @@ type hotplugCallback struct {
5858 fn HotPlugCbFunc
5959}
6060
61- // hotplugStorage holds the callback map and done channel for a single context.
62- type hotplugStorage struct {
61+ // HotplugCallbackStorage holds the callback map and done channel for a single
62+ // context.
63+ type HotplugCallbackStorage struct {
6364 callbackMap map [uint32 ]hotplugCallback
6465 done chan struct {}
6566 mu sync.RWMutex
@@ -73,20 +74,20 @@ const hotplugEventTimeoutMs = 200
7374// hotplugRegistry maps context pointers to their hotplug storage, allowing
7475// multiple contexts to register hotplug callbacks independently.
7576var (
76- hotplugRegistry = make (map [* C.libusb_context ]* hotplugStorage )
77+ hotplugRegistry = make (map [* C.libusb_context ]* HotplugCallbackStorage )
7778 hotplugRegistryMu sync.RWMutex
7879)
7980
8081func getHotplugStorage (
8182 libCtx * C.libusb_context ,
82- ) * hotplugStorage {
83+ ) * HotplugCallbackStorage {
8384 hotplugRegistryMu .RLock ()
8485 defer hotplugRegistryMu .RUnlock ()
8586 return hotplugRegistry [libCtx ]
8687}
8788
88- func (ctx * Context ) newHotPlugHandler () * hotplugStorage {
89- storage := & hotplugStorage {
89+ func (ctx * Context ) newHotPlugHandler () * HotplugCallbackStorage {
90+ storage := & HotplugCallbackStorage {
9091 callbackMap : make (map [uint32 ]hotplugCallback ),
9192 done : make (chan struct {}),
9293 }
@@ -99,7 +100,7 @@ func (ctx *Context) newHotPlugHandler() *hotplugStorage {
99100 return storage
100101}
101102
102- func (ctx * Context ) getOrCreateHotplugStorage () * hotplugStorage {
103+ func (ctx * Context ) getOrCreateHotplugStorage () * HotplugCallbackStorage {
103104 storage := getHotplugStorage (ctx .libusbContext )
104105 if storage == nil {
105106 storage = ctx .newHotPlugHandler ()
@@ -253,7 +254,7 @@ func (ctx *Context) hotplugHandleEventsCompleteAll() {
253254 removeHotplugStorage (ctx .libusbContext )
254255}
255256
256- func (storage * hotplugStorage ) handleEvents (
257+ func (storage * HotplugCallbackStorage ) handleEvents (
257258 libCtx * C.libusb_context ,
258259) {
259260 for {
0 commit comments