From ea4b7de4ac3265b954afc04527ffb3f695a9bac4 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 5 Jul 2020 12:55:01 +0100 Subject: [PATCH] Rename "commands" to "command" --- cmd/rove-server-rest-proxy/http_test.go | 4 +- cmd/rove-server/internal/routes.go | 6 +- cmd/rove/main.go | 8 +- cmd/rove/main_test.go | 10 +- pkg/rove/rove.pb.go | 242 ++++++++++++------------ pkg/rove/rove.pb.gw.go | 28 +-- pkg/rove/rove.swagger.json | 12 +- proto/rove/rove.proto | 8 +- 8 files changed, 159 insertions(+), 159 deletions(-) diff --git a/cmd/rove-server-rest-proxy/http_test.go b/cmd/rove-server-rest-proxy/http_test.go index e797a3b..c17081b 100644 --- a/cmd/rove-server-rest-proxy/http_test.go +++ b/cmd/rove-server-rest-proxy/http_test.go @@ -83,7 +83,7 @@ func TestServer_Command(t *testing.T) { err := serv.Request("POST", "register", &rove.RegisterRequest{Name: acc}, &rove.RegisterResponse{}) assert.NoError(t, err, "First register attempt should pass") - err = serv.Request("POST", "commands", &rove.CommandsRequest{ + err = serv.Request("POST", "command", &rove.CommandRequest{ Account: acc, Commands: []*rove.Command{ { @@ -91,7 +91,7 @@ func TestServer_Command(t *testing.T) { Bearing: "NE", }, }, - }, &rove.CommandsResponse{}) + }, &rove.CommandResponse{}) assert.NoError(t, err, "Commands should should pass") } diff --git a/cmd/rove-server/internal/routes.go b/cmd/rove-server/internal/routes.go index 264ede3..519856b 100644 --- a/cmd/rove-server/internal/routes.go +++ b/cmd/rove-server/internal/routes.go @@ -109,8 +109,8 @@ func (s *Server) Radar(ctx context.Context, req *rove.RadarRequest) (*rove.Radar return response, nil } -// Commands issues commands to the world based on a gRPC request -func (s *Server) Commands(ctx context.Context, req *rove.CommandsRequest) (*rove.CommandsResponse, error) { +// Command issues commands to the world based on a gRPC request +func (s *Server) Command(ctx context.Context, req *rove.CommandRequest) (*rove.CommandResponse, error) { if len(req.Account) == 0 { return nil, fmt.Errorf("empty account") } @@ -130,5 +130,5 @@ func (s *Server) Commands(ctx context.Context, req *rove.CommandsRequest) (*rove return nil, err } - return &rove.CommandsResponse{}, nil + return &rove.CommandResponse{}, nil } diff --git a/cmd/rove/main.go b/cmd/rove/main.go index 1498c74..af1fd6d 100644 --- a/cmd/rove/main.go +++ b/cmd/rove/main.go @@ -29,7 +29,7 @@ func printUsage() { fmt.Fprintln(os.Stderr, "\nCommands") fmt.Fprintln(os.Stderr, "\tserver-status prints the server status") fmt.Fprintln(os.Stderr, "\tregister NAME registers an account and stores it (use with -name)") - fmt.Fprintln(os.Stderr, "\tcommands COMMAND [VAL...] issue commands to rover, accepts multiple, see below") + fmt.Fprintln(os.Stderr, "\tcommand COMMAND [VAL...] issue commands to rover, accepts multiple, see below") fmt.Fprintln(os.Stderr, "\tradar gathers radar data for the current rover") fmt.Fprintln(os.Stderr, "\tstatus gets status info for current rover") fmt.Fprintln(os.Stderr, "\tconfig [HOST] outputs the local config info, optionally sets host") @@ -196,7 +196,7 @@ func InnerMain(command string, args ...string) error { config.Account.Name = name } - case "commands": + case "command": if len(args) == 0 { return fmt.Errorf("must pass commands to 'commands'") } @@ -228,7 +228,7 @@ func InnerMain(command string, args ...string) error { } } - d := rove.CommandsRequest{ + d := rove.CommandRequest{ Account: config.Account.Name, Commands: commands, } @@ -237,7 +237,7 @@ func InnerMain(command string, args ...string) error { return err } - _, err := client.Commands(ctx, &d) + _, err := client.Command(ctx, &d) switch { case err != nil: return err diff --git a/cmd/rove/main_test.go b/cmd/rove/main_test.go index 2118d1c..6f90fcd 100644 --- a/cmd/rove/main_test.go +++ b/cmd/rove/main_test.go @@ -47,13 +47,13 @@ func Test_InnerMain(t *testing.T) { assert.NoError(t, InnerMain("status")) // Commands should fail with no commands - assert.Error(t, InnerMain("commands")) + assert.Error(t, InnerMain("command")) // Give it commands - assert.NoError(t, InnerMain("commands", "move", "N")) - assert.NoError(t, InnerMain("commands", "stash")) - assert.NoError(t, InnerMain("commands", "repair")) + assert.NoError(t, InnerMain("command", "move", "N")) + assert.NoError(t, InnerMain("command", "stash")) + assert.NoError(t, InnerMain("command", "repair")) // Give it malformed commands - assert.Error(t, InnerMain("commands", "move", "stash")) + assert.Error(t, InnerMain("command", "move", "stash")) } diff --git a/pkg/rove/rove.pb.go b/pkg/rove/rove.pb.go index a1ef12a..d5ca946 100644 --- a/pkg/rove/rove.pb.go +++ b/pkg/rove/rove.pb.go @@ -95,7 +95,7 @@ func (x *Command) GetBearing() string { return "" } -type CommandsRequest struct { +type CommandRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -106,8 +106,8 @@ type CommandsRequest struct { Commands []*Command `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"` } -func (x *CommandsRequest) Reset() { - *x = CommandsRequest{} +func (x *CommandRequest) Reset() { + *x = CommandRequest{} if protoimpl.UnsafeEnabled { mi := &file_rove_rove_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -115,13 +115,13 @@ func (x *CommandsRequest) Reset() { } } -func (x *CommandsRequest) String() string { +func (x *CommandRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CommandsRequest) ProtoMessage() {} +func (*CommandRequest) ProtoMessage() {} -func (x *CommandsRequest) ProtoReflect() protoreflect.Message { +func (x *CommandRequest) ProtoReflect() protoreflect.Message { mi := &file_rove_rove_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -133,19 +133,19 @@ func (x *CommandsRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CommandsRequest.ProtoReflect.Descriptor instead. -func (*CommandsRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CommandRequest.ProtoReflect.Descriptor instead. +func (*CommandRequest) Descriptor() ([]byte, []int) { return file_rove_rove_proto_rawDescGZIP(), []int{1} } -func (x *CommandsRequest) GetAccount() string { +func (x *CommandRequest) GetAccount() string { if x != nil { return x.Account } return "" } -func (x *CommandsRequest) GetCommands() []*Command { +func (x *CommandRequest) GetCommands() []*Command { if x != nil { return x.Commands } @@ -153,14 +153,14 @@ func (x *CommandsRequest) GetCommands() []*Command { } // Empty placeholder -type CommandsResponse struct { +type CommandResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *CommandsResponse) Reset() { - *x = CommandsResponse{} +func (x *CommandResponse) Reset() { + *x = CommandResponse{} if protoimpl.UnsafeEnabled { mi := &file_rove_rove_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -168,13 +168,13 @@ func (x *CommandsResponse) Reset() { } } -func (x *CommandsResponse) String() string { +func (x *CommandResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CommandsResponse) ProtoMessage() {} +func (*CommandResponse) ProtoMessage() {} -func (x *CommandsResponse) ProtoReflect() protoreflect.Message { +func (x *CommandResponse) ProtoReflect() protoreflect.Message { mi := &file_rove_rove_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -186,8 +186,8 @@ func (x *CommandsResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CommandsResponse.ProtoReflect.Descriptor instead. -func (*CommandsResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use CommandResponse.ProtoReflect.Descriptor instead. +func (*CommandResponse) Descriptor() ([]byte, []int) { return file_rove_rove_proto_rawDescGZIP(), []int{2} } @@ -787,88 +787,88 @@ var file_rove_rove_proto_rawDesc = []byte{ 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x65, 0x61, - 0x72, 0x69, 0x6e, 0x67, 0x22, 0x56, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x29, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x12, 0x0a, 0x10, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1d, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x28, 0x0a, 0x0c, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x55, 0x0a, 0x0d, 0x52, 0x61, 0x64, - 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x22, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x0d, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa6, 0x02, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, - 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, - 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, - 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, - 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, - 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, - 0x79, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x78, - 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x22, - 0x15, 0x0a, 0x13, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x77, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, - 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72, - 0x65, 0x61, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x74, 0x69, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x01, 0x79, 0x32, 0x95, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x5d, - 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, - 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x6f, 0x76, 0x65, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, - 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, - 0x22, 0x09, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4f, - 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, - 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x0e, 0x22, 0x09, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x3a, 0x01, 0x2a, 0x12, - 0x43, 0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, - 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, - 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, - 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x47, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, - 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x0c, 0x22, 0x07, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x01, 0x2a, 0x42, 0x21, 0x5a, - 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, - 0x75, 0x7a, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x6f, 0x76, 0x65, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x69, 0x6e, 0x67, 0x22, 0x55, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x29, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, + 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x28, 0x0a, + 0x0c, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x55, 0x0a, 0x0d, 0x52, 0x61, 0x64, 0x61, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, + 0x69, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x12, + 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x0d, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa6, 0x02, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x70, + 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x70, + 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x49, 0x6e, + 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6d, + 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x69, 0x6d, + 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, + 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x22, 0x15, 0x0a, + 0x13, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x77, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, + 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, + 0x69, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a, + 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x01, 0x79, 0x32, 0x91, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x5d, 0x0a, 0x0c, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x2e, 0x72, + 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x08, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, + 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4b, 0x0a, 0x07, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x22, 0x08, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52, 0x61, 0x64, + 0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, + 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x47, + 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, + 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x22, 0x07, 0x2f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x3a, 0x01, 0x2a, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, 0x2f, 0x72, 0x6f, 0x76, + 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -886,8 +886,8 @@ func file_rove_rove_proto_rawDescGZIP() []byte { var file_rove_rove_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_rove_rove_proto_goTypes = []interface{}{ (*Command)(nil), // 0: rove.Command - (*CommandsRequest)(nil), // 1: rove.CommandsRequest - (*CommandsResponse)(nil), // 2: rove.CommandsResponse + (*CommandRequest)(nil), // 1: rove.CommandRequest + (*CommandResponse)(nil), // 2: rove.CommandResponse (*Error)(nil), // 3: rove.Error (*RadarRequest)(nil), // 4: rove.RadarRequest (*RadarResponse)(nil), // 5: rove.RadarResponse @@ -900,16 +900,16 @@ var file_rove_rove_proto_goTypes = []interface{}{ (*Vector)(nil), // 12: rove.Vector } var file_rove_rove_proto_depIdxs = []int32{ - 0, // 0: rove.CommandsRequest.commands:type_name -> rove.Command + 0, // 0: rove.CommandRequest.commands:type_name -> rove.Command 12, // 1: rove.StatusResponse.position:type_name -> rove.Vector 10, // 2: rove.Rove.ServerStatus:input_type -> rove.ServerStatusRequest 7, // 3: rove.Rove.Register:input_type -> rove.RegisterRequest - 1, // 4: rove.Rove.Commands:input_type -> rove.CommandsRequest + 1, // 4: rove.Rove.Command:input_type -> rove.CommandRequest 4, // 5: rove.Rove.Radar:input_type -> rove.RadarRequest 8, // 6: rove.Rove.Status:input_type -> rove.StatusRequest 11, // 7: rove.Rove.ServerStatus:output_type -> rove.ServerStatusResponse 6, // 8: rove.Rove.Register:output_type -> rove.RegisterResponse - 2, // 9: rove.Rove.Commands:output_type -> rove.CommandsResponse + 2, // 9: rove.Rove.Command:output_type -> rove.CommandResponse 5, // 10: rove.Rove.Radar:output_type -> rove.RadarResponse 9, // 11: rove.Rove.Status:output_type -> rove.StatusResponse 7, // [7:12] is the sub-list for method output_type @@ -938,7 +938,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandsRequest); i { + switch v := v.(*CommandRequest); i { case 0: return &v.state case 1: @@ -950,7 +950,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandsResponse); i { + switch v := v.(*CommandResponse); i { case 0: return &v.state case 1: @@ -1125,7 +1125,7 @@ type RoveClient interface { // Send commands to rover // // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent - Commands(ctx context.Context, in *CommandsRequest, opts ...grpc.CallOption) (*CommandsResponse, error) + Command(ctx context.Context, in *CommandRequest, opts ...grpc.CallOption) (*CommandResponse, error) // Get radar information // // Gets the radar output for the given rover @@ -1162,9 +1162,9 @@ func (c *roveClient) Register(ctx context.Context, in *RegisterRequest, opts ... return out, nil } -func (c *roveClient) Commands(ctx context.Context, in *CommandsRequest, opts ...grpc.CallOption) (*CommandsResponse, error) { - out := new(CommandsResponse) - err := c.cc.Invoke(ctx, "/rove.Rove/Commands", in, out, opts...) +func (c *roveClient) Command(ctx context.Context, in *CommandRequest, opts ...grpc.CallOption) (*CommandResponse, error) { + out := new(CommandResponse) + err := c.cc.Invoke(ctx, "/rove.Rove/Command", in, out, opts...) if err != nil { return nil, err } @@ -1202,7 +1202,7 @@ type RoveServer interface { // Send commands to rover // // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent - Commands(context.Context, *CommandsRequest) (*CommandsResponse, error) + Command(context.Context, *CommandRequest) (*CommandResponse, error) // Get radar information // // Gets the radar output for the given rover @@ -1223,8 +1223,8 @@ func (*UnimplementedRoveServer) ServerStatus(context.Context, *ServerStatusReque func (*UnimplementedRoveServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } -func (*UnimplementedRoveServer) Commands(context.Context, *CommandsRequest) (*CommandsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Commands not implemented") +func (*UnimplementedRoveServer) Command(context.Context, *CommandRequest) (*CommandResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Command not implemented") } func (*UnimplementedRoveServer) Radar(context.Context, *RadarRequest) (*RadarResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Radar not implemented") @@ -1273,20 +1273,20 @@ func _Rove_Register_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Rove_Commands_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CommandsRequest) +func _Rove_Command_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommandRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RoveServer).Commands(ctx, in) + return srv.(RoveServer).Command(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/rove.Rove/Commands", + FullMethod: "/rove.Rove/Command", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoveServer).Commands(ctx, req.(*CommandsRequest)) + return srv.(RoveServer).Command(ctx, req.(*CommandRequest)) } return interceptor(ctx, in, info, handler) } @@ -1340,8 +1340,8 @@ var _Rove_serviceDesc = grpc.ServiceDesc{ Handler: _Rove_Register_Handler, }, { - MethodName: "Commands", - Handler: _Rove_Commands_Handler, + MethodName: "Command", + Handler: _Rove_Command_Handler, }, { MethodName: "Radar", diff --git a/pkg/rove/rove.pb.gw.go b/pkg/rove/rove.pb.gw.go index cfb9d54..db3d25e 100644 --- a/pkg/rove/rove.pb.gw.go +++ b/pkg/rove/rove.pb.gw.go @@ -83,8 +83,8 @@ func local_request_Rove_Register_0(ctx context.Context, marshaler runtime.Marsha } -func request_Rove_Commands_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CommandsRequest +func request_Rove_Command_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CommandRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -95,13 +95,13 @@ func request_Rove_Commands_0(ctx context.Context, marshaler runtime.Marshaler, c return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Commands(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.Command(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Rove_Commands_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CommandsRequest +func local_request_Rove_Command_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CommandRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -112,7 +112,7 @@ func local_request_Rove_Commands_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Commands(ctx, &protoReq) + msg, err := server.Command(ctx, &protoReq) return msg, metadata, err } @@ -230,7 +230,7 @@ func RegisterRoveHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve }) - mux.Handle("POST", pattern_Rove_Commands_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Rove_Command_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -239,14 +239,14 @@ func RegisterRoveHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Rove_Commands_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Rove_Command_0(rctx, inboundMarshaler, server, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Rove_Commands_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Rove_Command_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -371,7 +371,7 @@ func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien }) - mux.Handle("POST", pattern_Rove_Commands_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Rove_Command_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -380,14 +380,14 @@ func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Rove_Commands_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Rove_Command_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Rove_Commands_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Rove_Command_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -439,7 +439,7 @@ var ( pattern_Rove_Register_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"register"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Rove_Commands_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"commands"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Rove_Command_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"command"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Rove_Radar_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"radar"}, "", runtime.AssumeColonVerbOpt(true))) @@ -451,7 +451,7 @@ var ( forward_Rove_Register_0 = runtime.ForwardResponseMessage - forward_Rove_Commands_0 = runtime.ForwardResponseMessage + forward_Rove_Command_0 = runtime.ForwardResponseMessage forward_Rove_Radar_0 = runtime.ForwardResponseMessage diff --git a/pkg/rove/rove.swagger.json b/pkg/rove/rove.swagger.json index cc4e6d6..d9f0932 100644 --- a/pkg/rove/rove.swagger.json +++ b/pkg/rove/rove.swagger.json @@ -12,16 +12,16 @@ "application/json" ], "paths": { - "/commands": { + "/command": { "post": { "summary": "Send commands to rover", "description": "Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent", - "operationId": "Rove_Commands", + "operationId": "Rove_Command", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/roveCommandsResponse" + "$ref": "#/definitions/roveCommandResponse" } }, "default": { @@ -37,7 +37,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/roveCommandsRequest" + "$ref": "#/definitions/roveCommandRequest" } } ], @@ -220,7 +220,7 @@ } } }, - "roveCommandsRequest": { + "roveCommandRequest": { "type": "object", "properties": { "account": { @@ -236,7 +236,7 @@ } } }, - "roveCommandsResponse": { + "roveCommandResponse": { "type": "object", "title": "Empty placeholder" }, diff --git a/proto/rove/rove.proto b/proto/rove/rove.proto index 54609b0..0c0c7bc 100644 --- a/proto/rove/rove.proto +++ b/proto/rove/rove.proto @@ -32,9 +32,9 @@ service Rove { // Send commands to rover // // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent - rpc Commands(CommandsRequest) returns (CommandsResponse) { + rpc Command(CommandRequest) returns (CommandResponse) { option (google.api.http) = { - post: "/commands" + post: "/command" body: "*" }; } @@ -72,7 +72,7 @@ message Command { string bearing = 2; } -message CommandsRequest { +message CommandRequest { // The account to execute these commands string account = 1; @@ -81,7 +81,7 @@ message CommandsRequest { } // Empty placeholder -message CommandsResponse {} +message CommandResponse {} message Error { // An explanation for the HTTP error returned