Add method ListIDs() to internal/data/Handlers
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
This commit is contained in:
@@ -38,3 +38,12 @@ func (shm *safeHandlerMap) Get(id string) (*model.Handler, bool) {
|
||||
shm.m.RUnlock()
|
||||
return h, ok
|
||||
}
|
||||
|
||||
func (shm *safeHandlerMap) ListIDs() (ids []string) {
|
||||
shm.m.RLock()
|
||||
defer shm.m.RUnlock()
|
||||
for id := range shm.hs {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user