safing-portbase/updater/export.go
Patrick Pacher 9d7fd1235d
Add support for custom index files.
This commit changes the updater package to support custom
index files by callling registry.AddIndex(). Note that the
previously hard-coded index files stable.json and beta.json
have been removed and must be added by using AddIndex() prior
to calling LoadIndexes().
2020-05-04 10:32:50 +02:00

16 lines
327 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
new := make(map[string]*Resource)
for key, val := range reg.resources {
new[key] = val
}
return new
}