diff --git a/cmd/rove-server/internal/routes.go b/cmd/rove-server/internal/routes.go index eae2a1d..911de92 100644 --- a/cmd/rove-server/internal/routes.go +++ b/cmd/rove-server/internal/routes.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "github.com/golang/protobuf/ptypes/empty" "github.com/google/uuid" "github.com/mdiluz/rove/pkg/accounts" "github.com/mdiluz/rove/pkg/game" @@ -13,7 +12,7 @@ import ( "google.golang.org/grpc" ) -func (s *Server) Status(context.Context, *empty.Empty) (*rove.StatusResponse, error) { +func (s *Server) Status(context.Context, *rove.StatusRequest) (*rove.StatusResponse, error) { response := &rove.StatusResponse{ Ready: true, Version: version.Version, @@ -30,7 +29,7 @@ func (s *Server) Status(context.Context, *empty.Empty) (*rove.StatusResponse, er return response, nil } -func (s *Server) Register(ctx context.Context, req *rove.RegisterRequest) (*empty.Empty, error) { +func (s *Server) Register(ctx context.Context, req *rove.RegisterRequest) (*rove.RegisterResponse, error) { if len(req.Name) == 0 { return nil, fmt.Errorf("empty account name") } @@ -46,7 +45,7 @@ func (s *Server) Register(ctx context.Context, req *rove.RegisterRequest) (*empt } - return &empty.Empty{}, nil + return &rove.RegisterResponse{}, nil } func (s *Server) Rover(ctx context.Context, req *rove.RoverRequest) (*rove.RoverResponse, error) { @@ -104,7 +103,7 @@ func (s *Server) Radar(ctx context.Context, req *rove.RadarRequest) (*rove.Radar return response, nil } -func (s *Server) Commands(ctx context.Context, req *rove.CommandsRequest) (*empty.Empty, error) { +func (s *Server) Commands(ctx context.Context, req *rove.CommandsRequest) (*rove.CommandsResponse, error) { if len(req.Account) == 0 { return nil, fmt.Errorf("empty account") } @@ -131,5 +130,5 @@ func (s *Server) Commands(ctx context.Context, req *rove.CommandsRequest) (*empt return nil, err } - return &empty.Empty{}, nil + return &rove.CommandsResponse{}, nil } diff --git a/cmd/rove/main.go b/cmd/rove/main.go index 3347afa..2df10d2 100644 --- a/cmd/rove/main.go +++ b/cmd/rove/main.go @@ -9,7 +9,6 @@ import ( "path" "time" - "github.com/golang/protobuf/ptypes/empty" "github.com/mdiluz/rove/pkg/game" "github.com/mdiluz/rove/pkg/rove" "github.com/mdiluz/rove/pkg/version" @@ -108,7 +107,7 @@ func InnerMain(command string) error { // Handle all the commands switch command { case "status": - response, err := client.Status(ctx, &empty.Empty{}) + response, err := client.Status(ctx, &rove.StatusRequest{}) switch { case err != nil: return err diff --git a/pkg/rove/rove.pb.go b/pkg/rove/rove.pb.go index e0a8cfe..8a790ca 100644 --- a/pkg/rove/rove.pb.go +++ b/pkg/rove/rove.pb.go @@ -9,7 +9,6 @@ package rove import ( context "context" proto "github.com/golang/protobuf/proto" - empty "github.com/golang/protobuf/ptypes/empty" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -37,9 +36,11 @@ type Command struct { unknownFields protoimpl.UnknownFields // The command to execute, currently only accepts move, which requires a bearing and a duration. - Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` - Bearing string `protobuf:"bytes,2,opt,name=bearing,proto3" json:"bearing,omitempty"` - Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` + Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + // The bearing, example: NE + Bearing string `protobuf:"bytes,2,opt,name=bearing,proto3" json:"bearing,omitempty"` + // The duration in ticks, example: 5 + Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` } func (x *Command) Reset() { @@ -100,7 +101,9 @@ type CommandsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + // The account to execture these commands + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + // The set of desired commands Commands []*Command `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"` } @@ -150,6 +153,45 @@ func (x *CommandsRequest) GetCommands() []*Command { return nil } +// Empty placeholder +type CommandsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CommandsResponse) Reset() { + *x = CommandsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommandsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandsResponse) ProtoMessage() {} + +func (x *CommandsResponse) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommandsResponse.ProtoReflect.Descriptor instead. +func (*CommandsResponse) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{2} +} + type Error struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -162,7 +204,7 @@ type Error struct { func (x *Error) Reset() { *x = Error{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[2] + mi := &file_rove_rove_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -175,7 +217,7 @@ func (x *Error) String() string { func (*Error) ProtoMessage() {} func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[2] + mi := &file_rove_rove_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -188,7 +230,7 @@ func (x *Error) ProtoReflect() protoreflect.Message { // Deprecated: Use Error.ProtoReflect.Descriptor instead. func (*Error) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{2} + return file_rove_rove_proto_rawDescGZIP(), []int{3} } func (x *Error) GetError() string { @@ -203,13 +245,14 @@ type RadarRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The account for this request Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } func (x *RadarRequest) Reset() { *x = RadarRequest{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[3] + mi := &file_rove_rove_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -222,7 +265,7 @@ func (x *RadarRequest) String() string { func (*RadarRequest) ProtoMessage() {} func (x *RadarRequest) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[3] + mi := &file_rove_rove_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -235,7 +278,7 @@ func (x *RadarRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RadarRequest.ProtoReflect.Descriptor instead. func (*RadarRequest) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{3} + return file_rove_rove_proto_rawDescGZIP(), []int{4} } func (x *RadarRequest) GetAccount() string { @@ -259,7 +302,7 @@ type RadarResponse struct { func (x *RadarResponse) Reset() { *x = RadarResponse{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[4] + mi := &file_rove_rove_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -272,7 +315,7 @@ func (x *RadarResponse) String() string { func (*RadarResponse) ProtoMessage() {} func (x *RadarResponse) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[4] + mi := &file_rove_rove_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -285,7 +328,7 @@ func (x *RadarResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RadarResponse.ProtoReflect.Descriptor instead. func (*RadarResponse) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{4} + return file_rove_rove_proto_rawDescGZIP(), []int{5} } func (x *RadarResponse) GetRange() int32 { @@ -302,18 +345,58 @@ func (x *RadarResponse) GetTiles() []byte { return nil } +// Empty placeholder +type RegisterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RegisterResponse) Reset() { + *x = RegisterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterResponse) ProtoMessage() {} + +func (x *RegisterResponse) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead. +func (*RegisterResponse) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{6} +} + type RegisterRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The desired account name Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *RegisterRequest) Reset() { *x = RegisterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[5] + mi := &file_rove_rove_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -326,7 +409,7 @@ func (x *RegisterRequest) String() string { func (*RegisterRequest) ProtoMessage() {} func (x *RegisterRequest) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[5] + mi := &file_rove_rove_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -339,7 +422,7 @@ func (x *RegisterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead. func (*RegisterRequest) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{5} + return file_rove_rove_proto_rawDescGZIP(), []int{7} } func (x *RegisterRequest) GetName() string { @@ -354,13 +437,14 @@ type RoverRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The account for this request Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } func (x *RoverRequest) Reset() { *x = RoverRequest{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[6] + mi := &file_rove_rove_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -373,7 +457,7 @@ func (x *RoverRequest) String() string { func (*RoverRequest) ProtoMessage() {} func (x *RoverRequest) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[6] + mi := &file_rove_rove_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -386,7 +470,7 @@ func (x *RoverRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RoverRequest.ProtoReflect.Descriptor instead. func (*RoverRequest) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{6} + return file_rove_rove_proto_rawDescGZIP(), []int{8} } func (x *RoverRequest) GetAccount() string { @@ -414,7 +498,7 @@ type RoverResponse struct { func (x *RoverResponse) Reset() { *x = RoverResponse{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[7] + mi := &file_rove_rove_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -427,7 +511,7 @@ func (x *RoverResponse) String() string { func (*RoverResponse) ProtoMessage() {} func (x *RoverResponse) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[7] + mi := &file_rove_rove_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -440,7 +524,7 @@ func (x *RoverResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RoverResponse.ProtoReflect.Descriptor instead. func (*RoverResponse) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{7} + return file_rove_rove_proto_rawDescGZIP(), []int{9} } func (x *RoverResponse) GetName() string { @@ -471,6 +555,45 @@ func (x *RoverResponse) GetSpeed() int32 { return 0 } +// Empty placeholder +type StatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StatusRequest) Reset() { + *x = StatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusRequest) ProtoMessage() {} + +func (x *StatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. +func (*StatusRequest) Descriptor() ([]byte, []int) { + return file_rove_rove_proto_rawDescGZIP(), []int{10} +} + type StatusResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -489,7 +612,7 @@ type StatusResponse struct { func (x *StatusResponse) Reset() { *x = StatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[8] + mi := &file_rove_rove_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -502,7 +625,7 @@ func (x *StatusResponse) String() string { func (*StatusResponse) ProtoMessage() {} func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[8] + mi := &file_rove_rove_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -515,7 +638,7 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{8} + return file_rove_rove_proto_rawDescGZIP(), []int{11} } func (x *StatusResponse) GetNextTick() string { @@ -558,7 +681,7 @@ type Vector struct { func (x *Vector) Reset() { *x = Vector{} if protoimpl.UnsafeEnabled { - mi := &file_rove_rove_proto_msgTypes[9] + mi := &file_rove_rove_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -571,7 +694,7 @@ func (x *Vector) String() string { func (*Vector) ProtoMessage() {} func (x *Vector) ProtoReflect() protoreflect.Message { - mi := &file_rove_rove_proto_msgTypes[9] + mi := &file_rove_rove_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -584,7 +707,7 @@ func (x *Vector) ProtoReflect() protoreflect.Message { // Deprecated: Use Vector.ProtoReflect.Descriptor instead. func (*Vector) Descriptor() ([]byte, []int) { - return file_rove_rove_proto_rawDescGZIP(), []int{9} + return file_rove_rove_proto_rawDescGZIP(), []int{12} } func (x *Vector) GetX() int32 { @@ -605,79 +728,80 @@ var File_rove_rove_proto protoreflect.FileDescriptor var file_rove_rove_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x04, 0x72, 0x6f, 0x76, 0x65, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 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, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 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, 0x3b, - 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, 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, 0x28, 0x0a, 0x0c, 0x52, 0x6f, 0x76, 0x65, 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, 0x79, 0x0a, 0x0d, - 0x52, 0x6f, 0x76, 0x65, 0x72, 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, 0x14, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x22, 0x71, 0x0a, 0x0e, 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, 0xf5, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x47, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x72, 0x6f, - 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, + 0x6f, 0x12, 0x04, 0x72, 0x6f, 0x76, 0x65, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 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, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 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, 0x3b, 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, 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, 0x28, 0x0a, + 0x0c, 0x52, 0x6f, 0x76, 0x65, 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, 0x79, 0x0a, 0x0d, 0x52, 0x6f, 0x76, 0x65, 0x72, + 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, 0x14, 0x0a, 0x05, + 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x70, 0x65, + 0x65, 0x64, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x71, 0x0a, 0x0e, 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, 0xf2, 0x02, 0x0a, + 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x44, 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, 0x0f, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x09, 0x12, 0x07, 0x2f, 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, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 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, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x14, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x40, 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, 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, - 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x12, 0x40, 0x0a, 0x05, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x12, - 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, - 0x12, 0x06, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x72, 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, + 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, 0x40, 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, + 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x12, + 0x40, 0x0a, 0x05, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, + 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, + 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, 0x2f, 0x72, 0x6f, 0x76, 0x65, + 0x72, 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 ( @@ -692,33 +816,35 @@ func file_rove_rove_proto_rawDescGZIP() []byte { return file_rove_rove_proto_rawDescData } -var file_rove_rove_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +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 - (*Error)(nil), // 2: rove.Error - (*RadarRequest)(nil), // 3: rove.RadarRequest - (*RadarResponse)(nil), // 4: rove.RadarResponse - (*RegisterRequest)(nil), // 5: rove.RegisterRequest - (*RoverRequest)(nil), // 6: rove.RoverRequest - (*RoverResponse)(nil), // 7: rove.RoverResponse - (*StatusResponse)(nil), // 8: rove.StatusResponse - (*Vector)(nil), // 9: rove.Vector - (*empty.Empty)(nil), // 10: google.protobuf.Empty + (*Command)(nil), // 0: rove.Command + (*CommandsRequest)(nil), // 1: rove.CommandsRequest + (*CommandsResponse)(nil), // 2: rove.CommandsResponse + (*Error)(nil), // 3: rove.Error + (*RadarRequest)(nil), // 4: rove.RadarRequest + (*RadarResponse)(nil), // 5: rove.RadarResponse + (*RegisterResponse)(nil), // 6: rove.RegisterResponse + (*RegisterRequest)(nil), // 7: rove.RegisterRequest + (*RoverRequest)(nil), // 8: rove.RoverRequest + (*RoverResponse)(nil), // 9: rove.RoverResponse + (*StatusRequest)(nil), // 10: rove.StatusRequest + (*StatusResponse)(nil), // 11: rove.StatusResponse + (*Vector)(nil), // 12: rove.Vector } var file_rove_rove_proto_depIdxs = []int32{ 0, // 0: rove.CommandsRequest.commands:type_name -> rove.Command - 9, // 1: rove.RoverResponse.position:type_name -> rove.Vector - 10, // 2: rove.Rove.Status:input_type -> google.protobuf.Empty - 5, // 3: rove.Rove.Register:input_type -> rove.RegisterRequest + 12, // 1: rove.RoverResponse.position:type_name -> rove.Vector + 10, // 2: rove.Rove.Status:input_type -> rove.StatusRequest + 7, // 3: rove.Rove.Register:input_type -> rove.RegisterRequest 1, // 4: rove.Rove.Commands:input_type -> rove.CommandsRequest - 3, // 5: rove.Rove.Radar:input_type -> rove.RadarRequest - 6, // 6: rove.Rove.Rover:input_type -> rove.RoverRequest - 8, // 7: rove.Rove.Status:output_type -> rove.StatusResponse - 10, // 8: rove.Rove.Register:output_type -> google.protobuf.Empty - 10, // 9: rove.Rove.Commands:output_type -> google.protobuf.Empty - 4, // 10: rove.Rove.Radar:output_type -> rove.RadarResponse - 7, // 11: rove.Rove.Rover:output_type -> rove.RoverResponse + 4, // 5: rove.Rove.Radar:input_type -> rove.RadarRequest + 8, // 6: rove.Rove.Rover:input_type -> rove.RoverRequest + 11, // 7: rove.Rove.Status:output_type -> rove.StatusResponse + 6, // 8: rove.Rove.Register:output_type -> rove.RegisterResponse + 2, // 9: rove.Rove.Commands:output_type -> rove.CommandsResponse + 5, // 10: rove.Rove.Radar:output_type -> rove.RadarResponse + 9, // 11: rove.Rove.Rover:output_type -> rove.RoverResponse 7, // [7:12] is the sub-list for method output_type 2, // [2:7] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -757,7 +883,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Error); i { + switch v := v.(*CommandsResponse); i { case 0: return &v.state case 1: @@ -769,7 +895,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RadarRequest); i { + switch v := v.(*Error); i { case 0: return &v.state case 1: @@ -781,7 +907,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RadarResponse); i { + switch v := v.(*RadarRequest); i { case 0: return &v.state case 1: @@ -793,7 +919,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterRequest); i { + switch v := v.(*RadarResponse); i { case 0: return &v.state case 1: @@ -805,7 +931,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoverRequest); i { + switch v := v.(*RegisterResponse); i { case 0: return &v.state case 1: @@ -817,7 +943,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoverResponse); i { + switch v := v.(*RegisterRequest); i { case 0: return &v.state case 1: @@ -829,7 +955,7 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusResponse); i { + switch v := v.(*RoverRequest); i { case 0: return &v.state case 1: @@ -841,6 +967,42 @@ func file_rove_rove_proto_init() { } } file_rove_rove_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoverResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Vector); i { case 0: return &v.state @@ -859,7 +1021,7 @@ func file_rove_rove_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_rove_rove_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, @@ -888,15 +1050,15 @@ type RoveClient interface { // Server status // // Responds with various details about the current server status - Status(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*StatusResponse, error) + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) // Register an account // // Tries to register an account with the given name - Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*empty.Empty, error) + Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) // 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) (*empty.Empty, error) + Commands(ctx context.Context, in *CommandsRequest, opts ...grpc.CallOption) (*CommandsResponse, error) // Get radar information // // Gets the radar output for the given rover @@ -915,7 +1077,7 @@ func NewRoveClient(cc grpc.ClientConnInterface) RoveClient { return &roveClient{cc} } -func (c *roveClient) Status(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*StatusResponse, error) { +func (c *roveClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) err := c.cc.Invoke(ctx, "/rove.Rove/Status", in, out, opts...) if err != nil { @@ -924,8 +1086,8 @@ func (c *roveClient) Status(ctx context.Context, in *empty.Empty, opts ...grpc.C return out, nil } -func (c *roveClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) +func (c *roveClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) { + out := new(RegisterResponse) err := c.cc.Invoke(ctx, "/rove.Rove/Register", in, out, opts...) if err != nil { return nil, err @@ -933,8 +1095,8 @@ 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) (*empty.Empty, error) { - out := new(empty.Empty) +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...) if err != nil { return nil, err @@ -965,15 +1127,15 @@ type RoveServer interface { // Server status // // Responds with various details about the current server status - Status(context.Context, *empty.Empty) (*StatusResponse, error) + Status(context.Context, *StatusRequest) (*StatusResponse, error) // Register an account // // Tries to register an account with the given name - Register(context.Context, *RegisterRequest) (*empty.Empty, error) + Register(context.Context, *RegisterRequest) (*RegisterResponse, error) // 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) (*empty.Empty, error) + Commands(context.Context, *CommandsRequest) (*CommandsResponse, error) // Get radar information // // Gets the radar output for the given rover @@ -988,13 +1150,13 @@ type RoveServer interface { type UnimplementedRoveServer struct { } -func (*UnimplementedRoveServer) Status(context.Context, *empty.Empty) (*StatusResponse, error) { +func (*UnimplementedRoveServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") } -func (*UnimplementedRoveServer) Register(context.Context, *RegisterRequest) (*empty.Empty, error) { +func (*UnimplementedRoveServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } -func (*UnimplementedRoveServer) Commands(context.Context, *CommandsRequest) (*empty.Empty, error) { +func (*UnimplementedRoveServer) Commands(context.Context, *CommandsRequest) (*CommandsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Commands not implemented") } func (*UnimplementedRoveServer) Radar(context.Context, *RadarRequest) (*RadarResponse, error) { @@ -1009,7 +1171,7 @@ func RegisterRoveServer(s *grpc.Server, srv RoveServer) { } func _Rove_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(empty.Empty) + in := new(StatusRequest) if err := dec(in); err != nil { return nil, err } @@ -1021,7 +1183,7 @@ func _Rove_Status_Handler(srv interface{}, ctx context.Context, dec func(interfa FullMethod: "/rove.Rove/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoveServer).Status(ctx, req.(*empty.Empty)) + return srv.(RoveServer).Status(ctx, req.(*StatusRequest)) } return interceptor(ctx, in, info, handler) } diff --git a/pkg/rove/rove.pb.gw.go b/pkg/rove/rove.pb.gw.go index cdd011c..f22b6a0 100644 --- a/pkg/rove/rove.pb.gw.go +++ b/pkg/rove/rove.pb.gw.go @@ -15,7 +15,6 @@ import ( "github.com/golang/protobuf/descriptor" "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/empty" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/grpc-ecosystem/grpc-gateway/utilities" "google.golang.org/grpc" @@ -33,7 +32,7 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage func request_Rove_Status_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq empty.Empty + var protoReq StatusRequest var metadata runtime.ServerMetadata msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -42,7 +41,7 @@ func request_Rove_Status_0(ctx context.Context, marshaler runtime.Marshaler, cli } func local_request_Rove_Status_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq empty.Empty + var protoReq StatusRequest var metadata runtime.ServerMetadata msg, err := server.Status(ctx, &protoReq) diff --git a/pkg/rove/rove.swagger.json b/pkg/rove/rove.swagger.json index a25d00a..3b46b33 100644 --- a/pkg/rove/rove.swagger.json +++ b/pkg/rove/rove.swagger.json @@ -20,7 +20,7 @@ "200": { "description": "A successful response.", "schema": { - "properties": {} + "$ref": "#/definitions/roveCommandsResponse" } }, "default": { @@ -67,6 +67,7 @@ "parameters": [ { "name": "account", + "description": "The account for this request.", "in": "query", "required": false, "type": "string" @@ -86,7 +87,7 @@ "200": { "description": "A successful response.", "schema": { - "properties": {} + "$ref": "#/definitions/roveRegisterResponse" } }, "default": { @@ -133,6 +134,7 @@ "parameters": [ { "name": "account", + "description": "The account for this request.", "in": "query", "required": false, "type": "string" @@ -210,11 +212,13 @@ "description": "The command to execute, currently only accepts move, which requires a bearing and a duration." }, "bearing": { - "type": "string" + "type": "string", + "title": "The bearing, example: NE" }, "duration": { "type": "integer", - "format": "int32" + "format": "int32", + "title": "The duration in ticks, example: 5" } } }, @@ -222,16 +226,22 @@ "type": "object", "properties": { "account": { - "type": "string" + "type": "string", + "title": "The account to execture these commands" }, "commands": { "type": "array", "items": { "$ref": "#/definitions/roveCommand" - } + }, + "title": "The set of desired commands" } } }, + "roveCommandsResponse": { + "type": "object", + "title": "Empty placeholder" + }, "roveRadarResponse": { "type": "object", "properties": { @@ -251,10 +261,15 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "title": "The desired account name" } } }, + "roveRegisterResponse": { + "type": "object", + "title": "Empty placeholder" + }, "roveRoverResponse": { "type": "object", "properties": { diff --git a/proto/rove/rove.proto b/proto/rove/rove.proto index c400cb8..d40bed0 100644 --- a/proto/rove/rove.proto +++ b/proto/rove/rove.proto @@ -4,14 +4,13 @@ package rove; option go_package = "github.com/mdiluz/rove/pkg/rove"; -import "google/protobuf/empty.proto"; import "google/api/annotations.proto"; service Rove { // Server status // // Responds with various details about the current server status - rpc Status(google.protobuf.Empty) returns (StatusResponse) { + rpc Status(StatusRequest) returns (StatusResponse) { option (google.api.http) = { get: "/status" }; @@ -20,7 +19,7 @@ service Rove { // Register an account // // Tries to register an account with the given name - rpc Register(RegisterRequest) returns (google.protobuf.Empty) { + rpc Register(RegisterRequest) returns (RegisterResponse) { option (google.api.http) = { post: "/register" body: "*" @@ -30,7 +29,7 @@ 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 (google.protobuf.Empty) { + rpc Commands(CommandsRequest) returns (CommandsResponse) { option (google.api.http) = { post: "/commands" body: "*" @@ -60,21 +59,31 @@ message Command { // The command to execute, currently only accepts move, which requires a bearing and a duration. string command = 1; + // The bearing, example: NE string bearing = 2; + + // The duration in ticks, example: 5 int32 duration = 3; } message CommandsRequest { + // The account to execture these commands string account = 1; + + // The set of desired commands repeated Command commands = 2; } +// Empty placeholder +message CommandsResponse {} + message Error { // An explanation for the HTTP error returned string error = 1; } message RadarRequest { + // The account for this request string account = 1; } @@ -86,11 +95,16 @@ message RadarResponse { bytes tiles = 2; } +// Empty placeholder +message RegisterResponse{} + message RegisterRequest { + // The desired account name string name = 1; } message RoverRequest { + // The account for this request string account = 1; } @@ -108,6 +122,9 @@ message RoverResponse { int32 speed = 4; } +// Empty placeholder +message StatusRequest {} + message StatusResponse { // The time the next tick will occur string next_tick = 1;