diff options
Diffstat (limited to 'weed/topology')
| -rw-r--r-- | weed/topology/topology.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/topology/topology.go b/weed/topology/topology.go index 77716605a..208c9b5b7 100644 --- a/weed/topology/topology.go +++ b/weed/topology/topology.go @@ -117,6 +117,13 @@ func (t *Topology) GetVolumeLayout(collectionName string, rp *storage.ReplicaPla }).(*Collection).GetOrCreateVolumeLayout(rp, ttl) } +func (t *Topology) ListCollections() (ret []*Collection) { + for _, c := range t.collectionMap.Items() { + ret = append(ret, c.(*Collection)) + } + return ret +} + func (t *Topology) FindCollection(collectionName string) (*Collection, bool) { c, hasCollection := t.collectionMap.Find(collectionName) if !hasCollection { |
