/* RPC proto to wrap client request and server responses*/

syntax = "proto3";

package rpc;

message RpcRequest {
    // RPC service full name
    optional string service_name = 1;

    // RPC method name
    optional string method_name = 2;

    // RPC request proto
    optional bytes request_proto = 3;
  }

message RpcResponse {
  // RPC service full name
  optional string service_name = 1;

  // RPC method name
  optional string method_name = 2;

  // RPC response proto
  optional bytes response_proto = 3;

  // Error handling

  optional string error_msg = 4;

  optional ErrorCode error_code = 5;

}

enum ErrorCode{
  BAD_MESSAGE_DATA = 0;
  INCOMPLETE_MESSAGE = 1;
  SERVICE_NOT_FOUND = 2;
  METHOD_NOT_FOUND = 3;
  RPC_FAILED = 4;
}