lib/protobuf/rpc/rpc.pb.rb



### Generated by rprotoc. DO NOT EDIT!
### <proto file: rpc.proto>
# // Copyright (c) 2009 Shardul Deo
# //
# // Permission is hereby granted, free of charge, to any person obtaining a copy
# // of this software and associated documentation files (the "Software"), to deal
# // in the Software without restriction, including without limitation the rights
# // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# // copies of the Software, and to permit persons to whom the Software is
# // furnished to do so, subject to the following conditions:
# //
# // The above copyright notice and this permission notice shall be included in
# // all copies or substantial portions of the Software.
# //
# // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# // THE SOFTWARE.
# 
# // Author: Shardul Deo
# //
# // Protobufs needed for socket rpcs.
# 
# package protobuf.socketrpc;
# 
# message Request {
# 
#   // RPC service full name
#   required string service_name = 1;
#   
#   // RPC method name
#   required string method_name = 2;
#   
#   // RPC request proto
#   required bytes request_proto = 3;
# }
# 
# message Response {
# 
#   // RPC response proto
#   optional bytes response_proto = 1;
#   
#   // Error, if any
#   optional string error = 2;
#   
#   // Was callback invoked
#   optional bool callback = 3 [default = false];
#   
#   // Error Reason
#   optional ErrorReason error_reason = 4;
# }
# 
# // Possible error reasons
# // The server-side errors are returned in the response from the server.
# // The client-side errors are returned by the client-side code when it doesn't 
# // have a response from the server.
# enum ErrorReason {
# 
#   // Server-side errors
#   BAD_REQUEST_DATA = 0; // Server received bad request data
#   BAD_REQUEST_PROTO = 1; // Server received bad request proto
#   SERVICE_NOT_FOUND = 2; // Service not found on server
#   METHOD_NOT_FOUND = 3; // Method not found on server
#   RPC_ERROR = 4; // Rpc threw exception on server
#   RPC_FAILED = 5; // Rpc failed on server
#   
#   // Client-side errors (these are returned by the client-side code)
#   INVALID_REQUEST_PROTO = 6; // Rpc was called with invalid request proto
#   BAD_RESPONSE_PROTO = 7; // Server returned a bad response proto
#   UNKNOWN_HOST = 8; // Could not find supplied host
#   IO_ERROR = 9; // I/O error while communicating with server
# }

require 'protobuf/message/message'
require 'protobuf/message/enum'
require 'protobuf/message/extend'

module Protobuf
  module Socketrpc
    class Request < ::Protobuf::Message
      required :string, :service_name, 1
      required :string, :method_name, 2
      required :bytes, :request_proto, 3
    end
    class Response < ::Protobuf::Message
      optional :bytes, :response_proto, 1
      optional :string, :error, 2
      optional :bool, :callback, 3, :default => false
      optional :ErrorReason, :error_reason, 4
    end
    class ErrorReason < ::Protobuf::Enum
      define :BAD_REQUEST_DATA, 0
      define :BAD_REQUEST_PROTO, 1
      define :SERVICE_NOT_FOUND, 2
      define :METHOD_NOT_FOUND, 3
      define :RPC_ERROR, 4
      define :RPC_FAILED, 5
      define :INVALID_REQUEST_PROTO, 6
      define :BAD_RESPONSE_PROTO, 7
      define :UNKNOWN_HOST, 8
      define :IO_ERROR, 9
    end
  end
end