SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
refactoring
Chris Luf08bbb72de4d
diff --git a/weed/shell/command_collection_list.go b/weed/shell/command_collection_list.goindex cc16fd2919..008a83e141 100644--- a/weed/shell/command_collection_list.go+++ b/weed/shell/command_collection_list.go@@ -24,22 +24,33 @@ func (c *commandCollectionList) Help() string {func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {+ collections, err := ListCollectionNames(commandEnv)++ if err != nil {+ return err+ }++ for _, c := range collections {+ fmt.Fprintf(writer, "collection:\"%s\"\n", c)+ }++ fmt.Fprintf(writer, "Total %d collections.\n", len(collections))++ return nil+}++func ListCollectionNames(commandEnv *commandEnv) (collections []string, err error) {var resp *master_pb.CollectionListResponsectx := context.Background()err = commandEnv.masterClient.WithClient(ctx, func(client master_pb.SeaweedClient) error {resp, err = client.CollectionList(ctx, &master_pb.CollectionListRequest{})return err})-if err != nil {- return err+ return}-for _, c := range resp.Collections {- fmt.Fprintf(writer, "collection:\"%s\"\n", c.GetName())+ collections = append(collections, c.Name)}-- fmt.Fprintf(writer, "Total %d collections.\n", len(resp.Collections))-- return nil+ return}