Rename "rover" to "status"

This commit is contained in:
Marc Di Luzio 2020-07-04 23:11:12 +01:00
parent f8e594cb39
commit 894359142b
7 changed files with 196 additions and 196 deletions

View file

@ -116,8 +116,8 @@ func TestServer_Rover(t *testing.T) {
err := serv.Request("POST", "register", &rove.RegisterRequest{Name: acc}, &rove.RegisterResponse{})
assert.NoError(t, err, "First register attempt should pass")
resp := &rove.RoverResponse{}
err = serv.Request("POST", "rover", &rove.RoverRequest{
resp := &rove.StatusResponse{}
err = serv.Request("POST", "status", &rove.StatusRequest{
Account: acc,
}, resp)
assert.NoError(t, err, "Rover sould pass should pass")

View file

@ -46,9 +46,9 @@ func (s *Server) Register(ctx context.Context, req *rove.RegisterRequest) (*rove
return &rove.RegisterResponse{}, nil
}
// Rover returns rover information for a gRPC request
func (s *Server) Rover(ctx context.Context, req *rove.RoverRequest) (*rove.RoverResponse, error) {
response := &rove.RoverResponse{}
// Status returns rover information for a gRPC request
func (s *Server) Status(ctx context.Context, req *rove.StatusRequest) (*rove.StatusResponse, error) {
response := &rove.StatusResponse{}
if len(req.Account) == 0 {
return nil, fmt.Errorf("empty account name")
@ -64,7 +64,7 @@ func (s *Server) Rover(ctx context.Context, req *rove.RoverRequest) (*rove.Rover
inv = append(inv, byte(i.Type))
}
response = &rove.RoverResponse{
response = &rove.StatusResponse{
Name: rover.Name,
Position: &rove.Vector{
X: int32(rover.Pos.X),

View file

@ -31,7 +31,7 @@ func printUsage() {
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, "\tradar gathers radar data for the current rover")
fmt.Fprintln(os.Stderr, "\trover gets data for 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")
fmt.Fprintln(os.Stderr, "\thelp outputs this usage information")
fmt.Fprintln(os.Stderr, "\tversion outputs version info")
@ -277,12 +277,12 @@ func InnerMain(command string, args ...string) error {
}
}
case "rover":
req := rove.RoverRequest{Account: config.Account.Name}
case "status":
req := rove.StatusRequest{Account: config.Account.Name}
if err := verifyID(req.Account); err != nil {
return err
}
response, err := client.Rover(ctx, &req)
response, err := client.Status(ctx, &req)
switch {
case err != nil:

View file

@ -440,7 +440,7 @@ func (x *RegisterRequest) GetName() string {
return ""
}
type RoverRequest struct {
type StatusRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -449,8 +449,8 @@ type RoverRequest struct {
Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
}
func (x *RoverRequest) Reset() {
*x = RoverRequest{}
func (x *StatusRequest) Reset() {
*x = StatusRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_rove_rove_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -458,13 +458,13 @@ func (x *RoverRequest) Reset() {
}
}
func (x *RoverRequest) String() string {
func (x *StatusRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RoverRequest) ProtoMessage() {}
func (*StatusRequest) ProtoMessage() {}
func (x *RoverRequest) ProtoReflect() protoreflect.Message {
func (x *StatusRequest) ProtoReflect() protoreflect.Message {
mi := &file_rove_rove_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -476,19 +476,19 @@ func (x *RoverRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use RoverRequest.ProtoReflect.Descriptor instead.
func (*RoverRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.
func (*StatusRequest) Descriptor() ([]byte, []int) {
return file_rove_rove_proto_rawDescGZIP(), []int{8}
}
func (x *RoverRequest) GetAccount() string {
func (x *StatusRequest) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
type RoverResponse struct {
type StatusResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -513,8 +513,8 @@ type RoverResponse struct {
MaximumCharge int32 `protobuf:"varint,9,opt,name=maximumCharge,proto3" json:"maximumCharge,omitempty"`
}
func (x *RoverResponse) Reset() {
*x = RoverResponse{}
func (x *StatusResponse) Reset() {
*x = StatusResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_rove_rove_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -522,13 +522,13 @@ func (x *RoverResponse) Reset() {
}
}
func (x *RoverResponse) String() string {
func (x *StatusResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RoverResponse) ProtoMessage() {}
func (*StatusResponse) ProtoMessage() {}
func (x *RoverResponse) ProtoReflect() protoreflect.Message {
func (x *StatusResponse) ProtoReflect() protoreflect.Message {
mi := &file_rove_rove_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -540,68 +540,68 @@ func (x *RoverResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use RoverResponse.ProtoReflect.Descriptor instead.
func (*RoverResponse) Descriptor() ([]byte, []int) {
// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) Descriptor() ([]byte, []int) {
return file_rove_rove_proto_rawDescGZIP(), []int{9}
}
func (x *RoverResponse) GetName() string {
func (x *StatusResponse) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *RoverResponse) GetPosition() *Vector {
func (x *StatusResponse) GetPosition() *Vector {
if x != nil {
return x.Position
}
return nil
}
func (x *RoverResponse) GetRange() int32 {
func (x *StatusResponse) GetRange() int32 {
if x != nil {
return x.Range
}
return 0
}
func (x *RoverResponse) GetInventory() []byte {
func (x *StatusResponse) GetInventory() []byte {
if x != nil {
return x.Inventory
}
return nil
}
func (x *RoverResponse) GetCapacity() int32 {
func (x *StatusResponse) GetCapacity() int32 {
if x != nil {
return x.Capacity
}
return 0
}
func (x *RoverResponse) GetIntegrity() int32 {
func (x *StatusResponse) GetIntegrity() int32 {
if x != nil {
return x.Integrity
}
return 0
}
func (x *RoverResponse) GetMaximumIntegrity() int32 {
func (x *StatusResponse) GetMaximumIntegrity() int32 {
if x != nil {
return x.MaximumIntegrity
}
return 0
}
func (x *RoverResponse) GetCharge() int32 {
func (x *StatusResponse) GetCharge() int32 {
if x != nil {
return x.Charge
}
return 0
}
func (x *RoverResponse) GetMaximumCharge() int32 {
func (x *StatusResponse) GetMaximumCharge() int32 {
if x != nil {
return x.MaximumCharge
}
@ -807,68 +807,68 @@ var file_rove_rove_proto_rawDesc = []byte{
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, 0xa5, 0x02, 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, 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, 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, 0x43, 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, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72,
0x6f, 0x76, 0x65, 0x72, 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,
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,
}
var (
@ -893,25 +893,25 @@ var file_rove_rove_proto_goTypes = []interface{}{
(*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), // 8: rove.StatusRequest
(*StatusResponse)(nil), // 9: rove.StatusResponse
(*ServerStatusRequest)(nil), // 10: rove.ServerStatusRequest
(*ServerStatusResponse)(nil), // 11: rove.ServerStatusResponse
(*Vector)(nil), // 12: rove.Vector
}
var file_rove_rove_proto_depIdxs = []int32{
0, // 0: rove.CommandsRequest.commands:type_name -> rove.Command
12, // 1: rove.RoverResponse.position:type_name -> rove.Vector
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
4, // 5: rove.Rove.Radar:input_type -> rove.RadarRequest
8, // 6: rove.Rove.Rover:input_type -> rove.RoverRequest
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
5, // 10: rove.Rove.Radar:output_type -> rove.RadarResponse
9, // 11: rove.Rove.Rover:output_type -> rove.RoverResponse
9, // 11: rove.Rove.Status:output_type -> rove.StatusResponse
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
@ -1022,7 +1022,7 @@ func file_rove_rove_proto_init() {
}
}
file_rove_rove_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RoverRequest); i {
switch v := v.(*StatusRequest); i {
case 0:
return &v.state
case 1:
@ -1034,7 +1034,7 @@ func file_rove_rove_proto_init() {
}
}
file_rove_rove_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RoverResponse); i {
switch v := v.(*StatusResponse); i {
case 0:
return &v.state
case 1:
@ -1133,7 +1133,7 @@ type RoveClient interface {
// Get rover information
//
// Gets information for the account's rover
Rover(ctx context.Context, in *RoverRequest, opts ...grpc.CallOption) (*RoverResponse, error)
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
}
type roveClient struct {
@ -1180,9 +1180,9 @@ func (c *roveClient) Radar(ctx context.Context, in *RadarRequest, opts ...grpc.C
return out, nil
}
func (c *roveClient) Rover(ctx context.Context, in *RoverRequest, opts ...grpc.CallOption) (*RoverResponse, error) {
out := new(RoverResponse)
err := c.cc.Invoke(ctx, "/rove.Rove/Rover", in, out, opts...)
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 {
return nil, err
}
@ -1210,7 +1210,7 @@ type RoveServer interface {
// Get rover information
//
// Gets information for the account's rover
Rover(context.Context, *RoverRequest) (*RoverResponse, error)
Status(context.Context, *StatusRequest) (*StatusResponse, error)
}
// UnimplementedRoveServer can be embedded to have forward compatible implementations.
@ -1229,8 +1229,8 @@ func (*UnimplementedRoveServer) Commands(context.Context, *CommandsRequest) (*Co
func (*UnimplementedRoveServer) Radar(context.Context, *RadarRequest) (*RadarResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Radar not implemented")
}
func (*UnimplementedRoveServer) Rover(context.Context, *RoverRequest) (*RoverResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Rover not implemented")
func (*UnimplementedRoveServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
}
func RegisterRoveServer(s *grpc.Server, srv RoveServer) {
@ -1309,20 +1309,20 @@ func _Rove_Radar_Handler(srv interface{}, ctx context.Context, dec func(interfac
return interceptor(ctx, in, info, handler)
}
func _Rove_Rover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RoverRequest)
func _Rove_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoveServer).Rover(ctx, in)
return srv.(RoveServer).Status(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rove.Rove/Rover",
FullMethod: "/rove.Rove/Status",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoveServer).Rover(ctx, req.(*RoverRequest))
return srv.(RoveServer).Status(ctx, req.(*StatusRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -1348,8 +1348,8 @@ var _Rove_serviceDesc = grpc.ServiceDesc{
Handler: _Rove_Radar_Handler,
},
{
MethodName: "Rover",
Handler: _Rove_Rover_Handler,
MethodName: "Status",
Handler: _Rove_Status_Handler,
},
},
Streams: []grpc.StreamDesc{},

View file

@ -151,8 +151,8 @@ func local_request_Rove_Radar_0(ctx context.Context, marshaler runtime.Marshaler
}
func request_Rove_Rover_0(ctx context.Context, marshaler runtime.Marshaler, client RoveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RoverRequest
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 StatusRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
@ -163,13 +163,13 @@ func request_Rove_Rover_0(ctx context.Context, marshaler runtime.Marshaler, clie
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Rover(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Rove_Rover_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RoverRequest
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 StatusRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
@ -180,7 +180,7 @@ func local_request_Rove_Rover_0(ctx context.Context, marshaler runtime.Marshaler
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Rover(ctx, &protoReq)
msg, err := server.Status(ctx, &protoReq)
return msg, metadata, err
}
@ -270,7 +270,7 @@ func RegisterRoveHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve
})
mux.Handle("POST", pattern_Rove_Rover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Rove_Status_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)
@ -279,14 +279,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_Rover_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_Rove_Status_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_Rover_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Rove_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -411,7 +411,7 @@ func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien
})
mux.Handle("POST", pattern_Rove_Rover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Rove_Status_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)
@ -420,14 +420,14 @@ func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Rove_Rover_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_Rove_Status_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_Rover_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Rove_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -443,7 +443,7 @@ var (
pattern_Rove_Radar_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"radar"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Rove_Rover_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"rover"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Rove_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"status"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
@ -455,5 +455,5 @@ var (
forward_Rove_Radar_0 = runtime.ForwardResponseMessage
forward_Rove_Rover_0 = runtime.ForwardResponseMessage
forward_Rove_Status_0 = runtime.ForwardResponseMessage
)

View file

@ -114,40 +114,6 @@
]
}
},
"/rover": {
"post": {
"summary": "Get rover information",
"description": "Gets information for the account's rover",
"operationId": "Rove_Rover",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/roveRoverResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/roveRoverRequest"
}
}
],
"tags": [
"Rove"
]
}
},
"/server-status": {
"get": {
"summary": "Server status",
@ -171,6 +137,40 @@
"Rove"
]
}
},
"/status": {
"post": {
"summary": "Get rover information",
"description": "Gets information for the account's rover",
"operationId": "Rove_Status",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/roveStatusResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/roveStatusRequest"
}
}
],
"tags": [
"Rove"
]
}
}
},
"definitions": {
@ -282,7 +282,30 @@
"type": "object",
"title": "Empty placeholder"
},
"roveRoverRequest": {
"roveServerStatusResponse": {
"type": "object",
"properties": {
"next_tick": {
"type": "string",
"title": "The time the next tick will occur"
},
"ready": {
"type": "boolean",
"format": "boolean",
"title": "Whether the server is ready to accept requests"
},
"tick": {
"type": "integer",
"format": "int32",
"title": "The tick rate of the server in minutes (how many minutes per tick)"
},
"version": {
"type": "string",
"title": "The version of the server in v{major}.{minor}-{delta}-{sha} form"
}
}
},
"roveStatusRequest": {
"type": "object",
"properties": {
"account": {
@ -291,7 +314,7 @@
}
}
},
"roveRoverResponse": {
"roveStatusResponse": {
"type": "object",
"properties": {
"name": {
@ -339,29 +362,6 @@
}
}
},
"roveServerStatusResponse": {
"type": "object",
"properties": {
"next_tick": {
"type": "string",
"title": "The time the next tick will occur"
},
"ready": {
"type": "boolean",
"format": "boolean",
"title": "Whether the server is ready to accept requests"
},
"tick": {
"type": "integer",
"format": "int32",
"title": "The tick rate of the server in minutes (how many minutes per tick)"
},
"version": {
"type": "string",
"title": "The version of the server in v{major}.{minor}-{delta}-{sha} form"
}
}
},
"roveVector": {
"type": "object",
"properties": {

View file

@ -52,9 +52,9 @@ service Rove {
// Get rover information
//
// Gets information for the account's rover
rpc Rover(RoverRequest) returns (RoverResponse) {
rpc Status(StatusRequest) returns (StatusResponse) {
option (google.api.http) = {
post: "/rover"
post: "/status"
body: "*"
};
}
@ -112,12 +112,12 @@ message RegisterRequest {
string name = 1;
}
message RoverRequest {
message StatusRequest {
// The account for this request
string account = 1;
}
message RoverResponse {
message StatusResponse {
// The name of the rover
string name = 1;