Rename "status" command to "server-status"
This commit is contained in:
parent
98eea89484
commit
f8e594cb39
8 changed files with 125 additions and 122 deletions
|
@ -61,10 +61,10 @@ func (s Server) Request(method, path string, in, out interface{}) error {
|
|||
|
||||
var serv = Server(os.Getenv("ROVE_HTTP"))
|
||||
|
||||
func TestServer_Status(t *testing.T) {
|
||||
req := &rove.StatusRequest{}
|
||||
resp := &rove.StatusResponse{}
|
||||
if err := serv.Request("GET", "status", req, resp); err != nil {
|
||||
func TestServer_ServerStatus(t *testing.T) {
|
||||
req := &rove.ServerStatusRequest{}
|
||||
resp := &rove.ServerStatusResponse{}
|
||||
if err := serv.Request("GET", "server-status", req, resp); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
)
|
||||
|
||||
// Status returns the status of the current server to a gRPC request
|
||||
func (s *Server) Status(context.Context, *rove.StatusRequest) (*rove.StatusResponse, error) {
|
||||
response := &rove.StatusResponse{
|
||||
func (s *Server) ServerStatus(context.Context, *rove.ServerStatusRequest) (*rove.ServerStatusResponse, error) {
|
||||
response := &rove.ServerStatusResponse{
|
||||
Ready: true,
|
||||
Version: version.Version,
|
||||
Tick: int32(s.tick),
|
||||
|
|
|
@ -27,7 +27,7 @@ var defaultDataPath = path.Join(home, ".local/share/")
|
|||
func printUsage() {
|
||||
fmt.Fprintf(os.Stderr, "Usage: rove COMMAND [ARGS...]\n")
|
||||
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, "\tcommands COMMAND [VAL...] issue commands to rover, accepts multiple, see below")
|
||||
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
|
||||
switch command {
|
||||
case "status":
|
||||
response, err := client.Status(ctx, &rove.StatusRequest{})
|
||||
case "server-status":
|
||||
response, err := client.ServerStatus(ctx, &rove.ServerStatusRequest{})
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
|
|
|
@ -26,11 +26,11 @@ func Test_InnerMain(t *testing.T) {
|
|||
}
|
||||
|
||||
// First attempt should error without a host
|
||||
assert.Error(t, InnerMain("status"))
|
||||
assert.Error(t, InnerMain("server-status"))
|
||||
|
||||
// Set the host in the config
|
||||
assert.NoError(t, InnerMain("config", address))
|
||||
assert.NoError(t, InnerMain("status"))
|
||||
assert.NoError(t, InnerMain("server-status"))
|
||||
|
||||
// Register should fail without a name
|
||||
assert.Error(t, InnerMain("register"))
|
||||
|
|
|
@ -609,14 +609,14 @@ func (x *RoverResponse) GetMaximumCharge() int32 {
|
|||
}
|
||||
|
||||
// Empty placeholder
|
||||
type StatusRequest struct {
|
||||
type ServerStatusRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *StatusRequest) Reset() {
|
||||
*x = StatusRequest{}
|
||||
func (x *ServerStatusRequest) Reset() {
|
||||
*x = ServerStatusRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rove_rove_proto_msgTypes[10]
|
||||
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)
|
||||
}
|
||||
|
||||
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]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
|
@ -642,12 +642,12 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message {
|
|||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StatusRequest) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use ServerStatusRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ServerStatusRequest) Descriptor() ([]byte, []int) {
|
||||
return file_rove_rove_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
type StatusResponse struct {
|
||||
type ServerStatusResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
@ -662,8 +662,8 @@ type StatusResponse struct {
|
|||
Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
|
||||
}
|
||||
|
||||
func (x *StatusResponse) Reset() {
|
||||
*x = StatusResponse{}
|
||||
func (x *ServerStatusResponse) Reset() {
|
||||
*x = ServerStatusResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rove_rove_proto_msgTypes[11]
|
||||
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)
|
||||
}
|
||||
|
||||
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]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
|
@ -689,33 +689,33 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message {
|
|||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StatusResponse) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use ServerStatusResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ServerStatusResponse) Descriptor() ([]byte, []int) {
|
||||
return file_rove_rove_proto_rawDescGZIP(), []int{11}
|
||||
}
|
||||
|
||||
func (x *StatusResponse) GetNextTick() string {
|
||||
func (x *ServerStatusResponse) GetNextTick() string {
|
||||
if x != nil {
|
||||
return x.NextTick
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StatusResponse) GetReady() bool {
|
||||
func (x *ServerStatusResponse) GetReady() bool {
|
||||
if x != nil {
|
||||
return x.Ready
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *StatusResponse) GetTick() int32 {
|
||||
func (x *ServerStatusResponse) GetTick() int32 {
|
||||
if x != nil {
|
||||
return x.Tick
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StatusResponse) GetVersion() string {
|
||||
func (x *ServerStatusResponse) GetVersion() string {
|
||||
if x != nil {
|
||||
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,
|
||||
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, 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, 0xf8, 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, 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,
|
||||
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,
|
||||
}
|
||||
|
||||
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_goTypes = []interface{}{
|
||||
(*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
|
||||
(*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
|
||||
(*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
|
||||
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
|
||||
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
|
||||
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
|
||||
2, // 9: rove.Rove.Commands:output_type -> rove.CommandsResponse
|
||||
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{} {
|
||||
switch v := v.(*StatusRequest); i {
|
||||
switch v := v.(*ServerStatusRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
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{} {
|
||||
switch v := v.(*StatusResponse); i {
|
||||
switch v := v.(*ServerStatusResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
|
@ -1114,7 +1117,7 @@ type RoveClient interface {
|
|||
// 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
|
||||
//
|
||||
// Tries to register an account with the given name
|
||||
|
@ -1141,9 +1144,9 @@ func NewRoveClient(cc grpc.ClientConnInterface) RoveClient {
|
|||
return &roveClient{cc}
|
||||
}
|
||||
|
||||
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...)
|
||||
func (c *roveClient) ServerStatus(ctx context.Context, in *ServerStatusRequest, opts ...grpc.CallOption) (*ServerStatusResponse, error) {
|
||||
out := new(ServerStatusResponse)
|
||||
err := c.cc.Invoke(ctx, "/rove.Rove/ServerStatus", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -1191,7 +1194,7 @@ type RoveServer interface {
|
|||
// 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
|
||||
//
|
||||
// Tries to register an account with the given name
|
||||
|
@ -1214,8 +1217,8 @@ type RoveServer interface {
|
|||
type UnimplementedRoveServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedRoveServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
|
||||
func (*UnimplementedRoveServer) ServerStatus(context.Context, *ServerStatusRequest) (*ServerStatusResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ServerStatus not implemented")
|
||||
}
|
||||
func (*UnimplementedRoveServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
|
||||
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)
|
||||
}
|
||||
|
||||
func _Rove_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StatusRequest)
|
||||
func _Rove_ServerStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServerStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RoveServer).Status(ctx, in)
|
||||
return srv.(RoveServer).ServerStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/rove.Rove/Status",
|
||||
FullMethod: "/rove.Rove/ServerStatus",
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
@ -1329,8 +1332,8 @@ var _Rove_serviceDesc = grpc.ServiceDesc{
|
|||
HandlerType: (*RoveServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Status",
|
||||
Handler: _Rove_Status_Handler,
|
||||
MethodName: "ServerStatus",
|
||||
Handler: _Rove_ServerStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Register",
|
||||
|
|
|
@ -31,20 +31,20 @@ var _ = runtime.String
|
|||
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 StatusRequest
|
||||
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 ServerStatusRequest
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
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 ServerStatusRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.Status(ctx, &protoReq)
|
||||
msg, err := server.ServerStatus(ctx, &protoReq)
|
||||
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.
|
||||
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())
|
||||
defer cancel()
|
||||
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)
|
||||
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)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
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.
|
||||
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())
|
||||
defer cancel()
|
||||
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)
|
||||
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)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
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 (
|
||||
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)))
|
||||
|
||||
|
@ -447,7 +447,7 @@ var (
|
|||
)
|
||||
|
||||
var (
|
||||
forward_Rove_Status_0 = runtime.ForwardResponseMessage
|
||||
forward_Rove_ServerStatus_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Rove_Register_0 = runtime.ForwardResponseMessage
|
||||
|
||||
|
|
|
@ -148,16 +148,16 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"/status": {
|
||||
"/server-status": {
|
||||
"get": {
|
||||
"summary": "Server status",
|
||||
"description": "Responds with various details about the current server status",
|
||||
"operationId": "Rove_Status",
|
||||
"operationId": "Rove_ServerStatus",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/roveStatusResponse"
|
||||
"$ref": "#/definitions/roveServerStatusResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
|
@ -339,7 +339,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"roveStatusResponse": {
|
||||
"roveServerStatusResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"next_tick": {
|
||||
|
|
|
@ -13,9 +13,9 @@ service Rove {
|
|||
// 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) = {
|
||||
get: "/status"
|
||||
get: "/server-status"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -147,9 +147,9 @@ message RoverResponse {
|
|||
}
|
||||
|
||||
// Empty placeholder
|
||||
message StatusRequest {}
|
||||
message ServerStatusRequest {}
|
||||
|
||||
message StatusResponse {
|
||||
message ServerStatusResponse {
|
||||
// The time the next tick will occur
|
||||
string next_tick = 1;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue