Rename "status" command to "server-status"

This commit is contained in:
Marc Di Luzio 2020-07-04 23:05:08 +01:00
parent 98eea89484
commit f8e594cb39
8 changed files with 125 additions and 122 deletions

View file

@ -61,10 +61,10 @@ func (s Server) Request(method, path string, in, out interface{}) error {
var serv = Server(os.Getenv("ROVE_HTTP")) var serv = Server(os.Getenv("ROVE_HTTP"))
func TestServer_Status(t *testing.T) { func TestServer_ServerStatus(t *testing.T) {
req := &rove.StatusRequest{} req := &rove.ServerStatusRequest{}
resp := &rove.StatusResponse{} resp := &rove.ServerStatusResponse{}
if err := serv.Request("GET", "status", req, resp); err != nil { if err := serv.Request("GET", "server-status", req, resp); err != nil {
log.Fatal(err) log.Fatal(err)
} }
} }

View file

@ -10,8 +10,8 @@ import (
) )
// Status returns the status of the current server to a gRPC request // Status returns the status of the current server to a gRPC request
func (s *Server) Status(context.Context, *rove.StatusRequest) (*rove.StatusResponse, error) { func (s *Server) ServerStatus(context.Context, *rove.ServerStatusRequest) (*rove.ServerStatusResponse, error) {
response := &rove.StatusResponse{ response := &rove.ServerStatusResponse{
Ready: true, Ready: true,
Version: version.Version, Version: version.Version,
Tick: int32(s.tick), Tick: int32(s.tick),

View file

@ -27,7 +27,7 @@ var defaultDataPath = path.Join(home, ".local/share/")
func printUsage() { func printUsage() {
fmt.Fprintf(os.Stderr, "Usage: rove COMMAND [ARGS...]\n") fmt.Fprintf(os.Stderr, "Usage: rove COMMAND [ARGS...]\n")
fmt.Fprintln(os.Stderr, "\nCommands") fmt.Fprintln(os.Stderr, "\nCommands")
fmt.Fprintln(os.Stderr, "\tstatus prints the server status") 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, "\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, "\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, "\tradar gathers radar data for the current rover")
@ -163,8 +163,8 @@ func InnerMain(command string, args ...string) error {
// Handle all the commands // Handle all the commands
switch command { switch command {
case "status": case "server-status":
response, err := client.Status(ctx, &rove.StatusRequest{}) response, err := client.ServerStatus(ctx, &rove.ServerStatusRequest{})
switch { switch {
case err != nil: case err != nil:
return err return err

View file

@ -26,11 +26,11 @@ func Test_InnerMain(t *testing.T) {
} }
// First attempt should error without a host // First attempt should error without a host
assert.Error(t, InnerMain("status")) assert.Error(t, InnerMain("server-status"))
// Set the host in the config // Set the host in the config
assert.NoError(t, InnerMain("config", address)) assert.NoError(t, InnerMain("config", address))
assert.NoError(t, InnerMain("status")) assert.NoError(t, InnerMain("server-status"))
// Register should fail without a name // Register should fail without a name
assert.Error(t, InnerMain("register")) assert.Error(t, InnerMain("register"))

View file

@ -609,14 +609,14 @@ func (x *RoverResponse) GetMaximumCharge() int32 {
} }
// Empty placeholder // Empty placeholder
type StatusRequest struct { type ServerStatusRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
} }
func (x *StatusRequest) Reset() { func (x *ServerStatusRequest) Reset() {
*x = StatusRequest{} *x = ServerStatusRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rove_rove_proto_msgTypes[10] mi := &file_rove_rove_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -624,13 +624,13 @@ func (x *StatusRequest) Reset() {
} }
} }
func (x *StatusRequest) String() string { func (x *ServerStatusRequest) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*StatusRequest) ProtoMessage() {} func (*ServerStatusRequest) ProtoMessage() {}
func (x *StatusRequest) ProtoReflect() protoreflect.Message { func (x *ServerStatusRequest) ProtoReflect() protoreflect.Message {
mi := &file_rove_rove_proto_msgTypes[10] mi := &file_rove_rove_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -642,12 +642,12 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. // Deprecated: Use ServerStatusRequest.ProtoReflect.Descriptor instead.
func (*StatusRequest) Descriptor() ([]byte, []int) { func (*ServerStatusRequest) Descriptor() ([]byte, []int) {
return file_rove_rove_proto_rawDescGZIP(), []int{10} return file_rove_rove_proto_rawDescGZIP(), []int{10}
} }
type StatusResponse struct { type ServerStatusResponse struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
@ -662,8 +662,8 @@ type StatusResponse struct {
Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
} }
func (x *StatusResponse) Reset() { func (x *ServerStatusResponse) Reset() {
*x = StatusResponse{} *x = ServerStatusResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rove_rove_proto_msgTypes[11] mi := &file_rove_rove_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -671,13 +671,13 @@ func (x *StatusResponse) Reset() {
} }
} }
func (x *StatusResponse) String() string { func (x *ServerStatusResponse) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*StatusResponse) ProtoMessage() {} func (*ServerStatusResponse) ProtoMessage() {}
func (x *StatusResponse) ProtoReflect() protoreflect.Message { func (x *ServerStatusResponse) ProtoReflect() protoreflect.Message {
mi := &file_rove_rove_proto_msgTypes[11] mi := &file_rove_rove_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -689,33 +689,33 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. // Deprecated: Use ServerStatusResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) Descriptor() ([]byte, []int) { func (*ServerStatusResponse) Descriptor() ([]byte, []int) {
return file_rove_rove_proto_rawDescGZIP(), []int{11} return file_rove_rove_proto_rawDescGZIP(), []int{11}
} }
func (x *StatusResponse) GetNextTick() string { func (x *ServerStatusResponse) GetNextTick() string {
if x != nil { if x != nil {
return x.NextTick return x.NextTick
} }
return "" return ""
} }
func (x *StatusResponse) GetReady() bool { func (x *ServerStatusResponse) GetReady() bool {
if x != nil { if x != nil {
return x.Ready return x.Ready
} }
return false return false
} }
func (x *StatusResponse) GetTick() int32 { func (x *ServerStatusResponse) GetTick() int32 {
if x != nil { if x != nil {
return x.Tick return x.Tick
} }
return 0 return 0
} }
func (x *StatusResponse) GetVersion() string { func (x *ServerStatusResponse) GetVersion() string {
if x != nil { if x != nil {
return x.Version return x.Version
} }
@ -828,44 +828,47 @@ var file_rove_rove_proto_rawDesc = []byte{
0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 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, 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, 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, 0x0f, 0x0a, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x22, 0x15, 0x0a,
0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x71, 0x13, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71,
0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x75, 0x65, 0x73, 0x74, 0x22, 0x77, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74,
0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09,
0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61,
0x61, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12,
0x05, 0x52, 0x04, 0x74, 0x69, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74,
0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x69, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04,
0x6e, 0x22, 0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x32, 0xf8, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x12, 0x44, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x52, 0x01, 0x79, 0x32, 0x91, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x5d, 0x0a, 0x0c,
0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x2e, 0x72,
0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x73, 0x65,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x08, 0x52,
0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52,
0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4f, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65,
0x6e, 0x64, 0x73, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09,
0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4f, 0x0a, 0x08,
0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e,
0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x63, 0x6f, 0x6d, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x6d, 0x61, 0x6e, 0x64, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52,
0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x09, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a,
0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61,
0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76,
0x05, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x3a,
0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f,
0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x3a, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x01, 0x2a, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72,
0x2f, 0x72, 0x6f, 0x76, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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,
} }
var ( var (
@ -882,29 +885,29 @@ func file_rove_rove_proto_rawDescGZIP() []byte {
var file_rove_rove_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_rove_rove_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_rove_rove_proto_goTypes = []interface{}{ var file_rove_rove_proto_goTypes = []interface{}{
(*Command)(nil), // 0: rove.Command (*Command)(nil), // 0: rove.Command
(*CommandsRequest)(nil), // 1: rove.CommandsRequest (*CommandsRequest)(nil), // 1: rove.CommandsRequest
(*CommandsResponse)(nil), // 2: rove.CommandsResponse (*CommandsResponse)(nil), // 2: rove.CommandsResponse
(*Error)(nil), // 3: rove.Error (*Error)(nil), // 3: rove.Error
(*RadarRequest)(nil), // 4: rove.RadarRequest (*RadarRequest)(nil), // 4: rove.RadarRequest
(*RadarResponse)(nil), // 5: rove.RadarResponse (*RadarResponse)(nil), // 5: rove.RadarResponse
(*RegisterResponse)(nil), // 6: rove.RegisterResponse (*RegisterResponse)(nil), // 6: rove.RegisterResponse
(*RegisterRequest)(nil), // 7: rove.RegisterRequest (*RegisterRequest)(nil), // 7: rove.RegisterRequest
(*RoverRequest)(nil), // 8: rove.RoverRequest (*RoverRequest)(nil), // 8: rove.RoverRequest
(*RoverResponse)(nil), // 9: rove.RoverResponse (*RoverResponse)(nil), // 9: rove.RoverResponse
(*StatusRequest)(nil), // 10: rove.StatusRequest (*ServerStatusRequest)(nil), // 10: rove.ServerStatusRequest
(*StatusResponse)(nil), // 11: rove.StatusResponse (*ServerStatusResponse)(nil), // 11: rove.ServerStatusResponse
(*Vector)(nil), // 12: rove.Vector (*Vector)(nil), // 12: rove.Vector
} }
var file_rove_rove_proto_depIdxs = []int32{ var file_rove_rove_proto_depIdxs = []int32{
0, // 0: rove.CommandsRequest.commands:type_name -> rove.Command 0, // 0: rove.CommandsRequest.commands:type_name -> rove.Command
12, // 1: rove.RoverResponse.position:type_name -> rove.Vector 12, // 1: rove.RoverResponse.position:type_name -> rove.Vector
10, // 2: rove.Rove.Status:input_type -> rove.StatusRequest 10, // 2: rove.Rove.ServerStatus:input_type -> rove.ServerStatusRequest
7, // 3: rove.Rove.Register:input_type -> rove.RegisterRequest 7, // 3: rove.Rove.Register:input_type -> rove.RegisterRequest
1, // 4: rove.Rove.Commands:input_type -> rove.CommandsRequest 1, // 4: rove.Rove.Commands:input_type -> rove.CommandsRequest
4, // 5: rove.Rove.Radar:input_type -> rove.RadarRequest 4, // 5: rove.Rove.Radar:input_type -> rove.RadarRequest
8, // 6: rove.Rove.Rover:input_type -> rove.RoverRequest 8, // 6: rove.Rove.Rover:input_type -> rove.RoverRequest
11, // 7: rove.Rove.Status:output_type -> rove.StatusResponse 11, // 7: rove.Rove.ServerStatus:output_type -> rove.ServerStatusResponse
6, // 8: rove.Rove.Register:output_type -> rove.RegisterResponse 6, // 8: rove.Rove.Register:output_type -> rove.RegisterResponse
2, // 9: rove.Rove.Commands:output_type -> rove.CommandsResponse 2, // 9: rove.Rove.Commands:output_type -> rove.CommandsResponse
5, // 10: rove.Rove.Radar:output_type -> rove.RadarResponse 5, // 10: rove.Rove.Radar:output_type -> rove.RadarResponse
@ -1043,7 +1046,7 @@ func file_rove_rove_proto_init() {
} }
} }
file_rove_rove_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { file_rove_rove_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatusRequest); i { switch v := v.(*ServerStatusRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1055,7 +1058,7 @@ func file_rove_rove_proto_init() {
} }
} }
file_rove_rove_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { file_rove_rove_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatusResponse); i { switch v := v.(*ServerStatusResponse); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1114,7 +1117,7 @@ type RoveClient interface {
// Server status // Server status
// //
// Responds with various details about the current server status // Responds with various details about the current server status
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) ServerStatus(ctx context.Context, in *ServerStatusRequest, opts ...grpc.CallOption) (*ServerStatusResponse, error)
// Register an account // Register an account
// //
// Tries to register an account with the given name // Tries to register an account with the given name
@ -1141,9 +1144,9 @@ func NewRoveClient(cc grpc.ClientConnInterface) RoveClient {
return &roveClient{cc} return &roveClient{cc}
} }
func (c *roveClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { func (c *roveClient) ServerStatus(ctx context.Context, in *ServerStatusRequest, opts ...grpc.CallOption) (*ServerStatusResponse, error) {
out := new(StatusResponse) out := new(ServerStatusResponse)
err := c.cc.Invoke(ctx, "/rove.Rove/Status", in, out, opts...) err := c.cc.Invoke(ctx, "/rove.Rove/ServerStatus", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1191,7 +1194,7 @@ type RoveServer interface {
// Server status // Server status
// //
// Responds with various details about the current server status // Responds with various details about the current server status
Status(context.Context, *StatusRequest) (*StatusResponse, error) ServerStatus(context.Context, *ServerStatusRequest) (*ServerStatusResponse, error)
// Register an account // Register an account
// //
// Tries to register an account with the given name // Tries to register an account with the given name
@ -1214,8 +1217,8 @@ type RoveServer interface {
type UnimplementedRoveServer struct { type UnimplementedRoveServer struct {
} }
func (*UnimplementedRoveServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { func (*UnimplementedRoveServer) ServerStatus(context.Context, *ServerStatusRequest) (*ServerStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") return nil, status.Errorf(codes.Unimplemented, "method ServerStatus not implemented")
} }
func (*UnimplementedRoveServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) { func (*UnimplementedRoveServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
@ -1234,20 +1237,20 @@ func RegisterRoveServer(s *grpc.Server, srv RoveServer) {
s.RegisterService(&_Rove_serviceDesc, srv) s.RegisterService(&_Rove_serviceDesc, srv)
} }
func _Rove_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Rove_ServerStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatusRequest) in := new(ServerStatusRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(RoveServer).Status(ctx, in) return srv.(RoveServer).ServerStatus(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/rove.Rove/Status", FullMethod: "/rove.Rove/ServerStatus",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoveServer).Status(ctx, req.(*StatusRequest)) return srv.(RoveServer).ServerStatus(ctx, req.(*ServerStatusRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -1329,8 +1332,8 @@ var _Rove_serviceDesc = grpc.ServiceDesc{
HandlerType: (*RoveServer)(nil), HandlerType: (*RoveServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "Status", MethodName: "ServerStatus",
Handler: _Rove_Status_Handler, Handler: _Rove_ServerStatus_Handler,
}, },
{ {
MethodName: "Register", MethodName: "Register",

View file

@ -31,20 +31,20 @@ var _ = runtime.String
var _ = utilities.NewDoubleArray var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage 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) { func request_Rove_ServerStatus_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 protoReq ServerStatusRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ServerStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
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) { func local_request_Rove_ServerStatus_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 protoReq ServerStatusRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
msg, err := server.Status(ctx, &protoReq) msg, err := server.ServerStatus(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
@ -190,7 +190,7 @@ func local_request_Rove_Rover_0(ctx context.Context, marshaler runtime.Marshaler
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterRoveHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RoveServer) error { func RegisterRoveHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RoveServer) error {
mux.Handle("GET", pattern_Rove_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Rove_ServerStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@ -199,14 +199,14 @@ func RegisterRoveHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := local_request_Rove_Status_0(rctx, inboundMarshaler, server, req, pathParams) resp, md, err := local_request_Rove_ServerStatus_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
forward_Rove_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_Rove_ServerStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
@ -331,7 +331,7 @@ func RegisterRoveHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.
// "RoveClient" to call the correct interceptors. // "RoveClient" to call the correct interceptors.
func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RoveClient) error { func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RoveClient) error {
mux.Handle("GET", pattern_Rove_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Rove_ServerStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@ -340,14 +340,14 @@ func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := request_Rove_Status_0(rctx, inboundMarshaler, client, req, pathParams) resp, md, err := request_Rove_ServerStatus_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
forward_Rove_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_Rove_ServerStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
@ -435,7 +435,7 @@ func RegisterRoveHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien
} }
var ( var (
pattern_Rove_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"status"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Rove_ServerStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"server-status"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Rove_Register_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"register"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Rove_Register_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"register"}, "", runtime.AssumeColonVerbOpt(true)))
@ -447,7 +447,7 @@ var (
) )
var ( var (
forward_Rove_Status_0 = runtime.ForwardResponseMessage forward_Rove_ServerStatus_0 = runtime.ForwardResponseMessage
forward_Rove_Register_0 = runtime.ForwardResponseMessage forward_Rove_Register_0 = runtime.ForwardResponseMessage

View file

@ -148,16 +148,16 @@
] ]
} }
}, },
"/status": { "/server-status": {
"get": { "get": {
"summary": "Server status", "summary": "Server status",
"description": "Responds with various details about the current server status", "description": "Responds with various details about the current server status",
"operationId": "Rove_Status", "operationId": "Rove_ServerStatus",
"responses": { "responses": {
"200": { "200": {
"description": "A successful response.", "description": "A successful response.",
"schema": { "schema": {
"$ref": "#/definitions/roveStatusResponse" "$ref": "#/definitions/roveServerStatusResponse"
} }
}, },
"default": { "default": {
@ -339,7 +339,7 @@
} }
} }
}, },
"roveStatusResponse": { "roveServerStatusResponse": {
"type": "object", "type": "object",
"properties": { "properties": {
"next_tick": { "next_tick": {

View file

@ -13,9 +13,9 @@ service Rove {
// Server status // Server status
// //
// Responds with various details about the current server status // Responds with various details about the current server status
rpc Status(StatusRequest) returns (StatusResponse) { rpc ServerStatus(ServerStatusRequest) returns (ServerStatusResponse) {
option (google.api.http) = { option (google.api.http) = {
get: "/status" get: "/server-status"
}; };
} }
@ -147,9 +147,9 @@ message RoverResponse {
} }
// Empty placeholder // Empty placeholder
message StatusRequest {} message ServerStatusRequest {}
message StatusResponse { message ServerStatusResponse {
// The time the next tick will occur // The time the next tick will occur
string next_tick = 1; string next_tick = 1;