• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Generated by the protocol buffer compiler.  DO NOT EDIT!
2# Source: src/proto/grpc/testing/test.proto for package 'grpc.testing'
3# Original file comments:
4# Copyright 2015-2016 gRPC authors.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18# An integration test service that covers all the method signature permutations
19# of unary/streaming requests/responses.
20#
21
22require 'grpc'
23require 'src/proto/grpc/testing/test_pb'
24
25module Grpc
26  module Testing
27    module TestService
28      # A simple service to test the various types of RPCs and experiment with
29      # performance with various types of payload.
30      class Service
31
32        include GRPC::GenericService
33
34        self.marshal_class_method = :encode
35        self.unmarshal_class_method = :decode
36        self.service_name = 'grpc.testing.TestService'
37
38        # One empty request followed by one empty response.
39        rpc :EmptyCall, Empty, Empty
40        # One request followed by one response.
41        rpc :UnaryCall, SimpleRequest, SimpleResponse
42        # One request followed by one response. Response has cache control
43        # headers set such that a caching HTTP proxy (such as GFE) can
44        # satisfy subsequent requests.
45        rpc :CacheableUnaryCall, SimpleRequest, SimpleResponse
46        # One request followed by a sequence of responses (streamed download).
47        # The server returns the payload with client desired type and sizes.
48        rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse)
49        # A sequence of requests followed by one response (streamed upload).
50        # The server returns the aggregated size of client payload as the result.
51        rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse
52        # A sequence of requests with each request served by the server immediately.
53        # As one request could lead to multiple responses, this interface
54        # demonstrates the idea of full duplexing.
55        rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
56        # A sequence of requests followed by a sequence of responses.
57        # The server buffers all the client requests and then serves them in order. A
58        # stream of responses are returned to the client when the server starts with
59        # first request.
60        rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
61        # The test server will not implement this method. It will be used
62        # to test the behavior when clients call unimplemented methods.
63        rpc :UnimplementedCall, Empty, Empty
64      end
65
66      Stub = Service.rpc_stub_class
67    end
68    module UnimplementedService
69      # A simple service NOT implemented at servers so clients can test for
70      # that case.
71      class Service
72
73        include GRPC::GenericService
74
75        self.marshal_class_method = :encode
76        self.unmarshal_class_method = :decode
77        self.service_name = 'grpc.testing.UnimplementedService'
78
79        # A call that no server should implement
80        rpc :UnimplementedCall, Empty, Empty
81      end
82
83      Stub = Service.rpc_stub_class
84    end
85    module ReconnectService
86      # A service used to control reconnect server.
87      class Service
88
89        include GRPC::GenericService
90
91        self.marshal_class_method = :encode
92        self.unmarshal_class_method = :decode
93        self.service_name = 'grpc.testing.ReconnectService'
94
95        rpc :Start, ReconnectParams, Empty
96        rpc :Stop, Empty, ReconnectInfo
97      end
98
99      Stub = Service.rpc_stub_class
100    end
101  end
102end
103