mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-18 23:47:55 +08:00
refactoring
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user