aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/topology.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/topology/topology.go')
-rw-r--r--weed/topology/topology.go7
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 {