aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_collection_list.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@uber.com>2019-03-19 05:19:37 -0700
committerChris Lu <chris.lu@uber.com>2019-03-19 05:19:37 -0700
commiteb4a54d9fe865eafb4de12db96b3e668b333fd1a (patch)
tree1b98cca002c99c2e74abc5cc46a51e61b982df89 /weed/shell/command_collection_list.go
parentece9d133122fd15faa4efd1b4cec34974e3b37d0 (diff)
downloadseaweedfs-eb4a54d9fe865eafb4de12db96b3e668b333fd1a.tar.xz
seaweedfs-eb4a54d9fe865eafb4de12db96b3e668b333fd1a.zip
refactoring
Diffstat (limited to 'weed/shell/command_collection_list.go')
-rw-r--r--weed/shell/command_collection_list.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/weed/shell/command_collection_list.go b/weed/shell/command_collection_list.go
index 34a406d67..0797e56fb 100644
--- a/weed/shell/command_collection_list.go
+++ b/weed/shell/command_collection_list.go
@@ -3,6 +3,7 @@ package shell
import (
"context"
"fmt"
+ "github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"io"
)
@@ -21,9 +22,14 @@ func (c *commandCollectionList) Help() string {
return "# list all collections"
}
-func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) error {
+func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
- resp, err := commandEnv.masterClient.CollectionList(context.Background())
+ var resp *master_pb.CollectionListResponse
+
+ err = commandEnv.masterClient.WithClient(context.Background(), func(ctx context.Context, client master_pb.SeaweedClient) error {
+ resp, err = client.CollectionList(ctx, &master_pb.CollectionListRequest{})
+ return err
+ })
if err != nil {
return err