safing-portbase/updater/export.go
2022-02-01 13:12:46 +01:00

16 lines
363 B
Go

package updater
// Export exports the list of resources. All resources must be
// locked when accessed.
func (reg *ResourceRegistry) Export() map[string]*Resource {
reg.RLock()
defer reg.RUnlock()
// copy the map
copiedResources := make(map[string]*Resource)
for key, val := range reg.resources {
copiedResources[key] = val
}
return copiedResources
}