• 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, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
40        # One request followed by one response.
41        rpc :UnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::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, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::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, ::Grpc::Testing::StreamingOutputCallRequest, stream(::Grpc::Testing::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(::Grpc::Testing::StreamingInputCallRequest), ::Grpc::Testing::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(::Grpc::Testing::StreamingOutputCallRequest), stream(::Grpc::Testing::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(::Grpc::Testing::StreamingOutputCallRequest), stream(::Grpc::Testing::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, ::Grpc::Testing::Empty, ::Grpc::Testing::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, ::Grpc::Testing::Empty, ::Grpc::Testing::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, ::Grpc::Testing::ReconnectParams, ::Grpc::Testing::Empty
96        rpc :Stop, ::Grpc::Testing::Empty, ::Grpc::Testing::ReconnectInfo
97      end
98
99      Stub = Service.rpc_stub_class
100    end
101    module LoadBalancerStatsService
102      # A service used to obtain stats for verifying LB behavior.
103      class Service
104
105        include GRPC::GenericService
106
107        self.marshal_class_method = :encode
108        self.unmarshal_class_method = :decode
109        self.service_name = 'grpc.testing.LoadBalancerStatsService'
110
111        # Gets the backend distribution for RPCs sent by a test client.
112        rpc :GetClientStats, ::Grpc::Testing::LoadBalancerStatsRequest, ::Grpc::Testing::LoadBalancerStatsResponse
113        # Gets the accumulated stats for RPCs sent by a test client.
114        rpc :GetClientAccumulatedStats, ::Grpc::Testing::LoadBalancerAccumulatedStatsRequest, ::Grpc::Testing::LoadBalancerAccumulatedStatsResponse
115      end
116
117      Stub = Service.rpc_stub_class
118    end
119    module XdsUpdateHealthService
120      # A service to remotely control health status of an xDS test server.
121      class Service
122
123        include GRPC::GenericService
124
125        self.marshal_class_method = :encode
126        self.unmarshal_class_method = :decode
127        self.service_name = 'grpc.testing.XdsUpdateHealthService'
128
129        rpc :SetServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
130        rpc :SetNotServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
131      end
132
133      Stub = Service.rpc_stub_class
134    end
135    module XdsUpdateClientConfigureService
136      # A service to dynamically update the configuration of an xDS test client.
137      class Service
138
139        include GRPC::GenericService
140
141        self.marshal_class_method = :encode
142        self.unmarshal_class_method = :decode
143        self.service_name = 'grpc.testing.XdsUpdateClientConfigureService'
144
145        # Update the tes client's configuration.
146        rpc :Configure, ::Grpc::Testing::ClientConfigureRequest, ::Grpc::Testing::ClientConfigureResponse
147      end
148
149      Stub = Service.rpc_stub_class
150    end
151  end
152end
153