Simplify space locked solution
This commit is contained in:
1 parent
af5077d1c2
commit
0d0bd82dc7
3 files changed
+94
-92
No files matched your search
@@ -209,6 +209,23 @@ func (s *service) registerClientCommands() {
|
||||
}
|
||||
return
|
||||
}}
|
||||
s.clientCommands["all-spaces"] = Command{Cmd: func(server peers.Peer, params []string) (res string, err error) {
|
||||
if len(params) != 0 {
|
||||
err = ErrIncorrectParamsCount
|
||||
return
|
||||
}
|
||||
resp, err := client.AllSpaces(context.Background(), server.Address, &apiproto.AllSpacesRequest{})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for treeIdx, spaceId := range resp.SpaceIds {
|
||||
res += spaceId
|
||||
if treeIdx != len(resp.SpaceIds)-1 {
|
||||
res += "\n"
|
||||
}
|
||||
}
|
||||
return
|
||||
}}
|
||||
}
|
||||
|
||||
func (s *service) registerNodeCommands() {
|
||||
|
||||
Reference in new issue
Block a user