OSDN Git Service

new repo
[bytom/vapor.git] / vendor / google.golang.org / grpc / stats / grpc_testing / test.pb.go
1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: grpc_testing/test.proto
3
4 /*
5 Package grpc_testing is a generated protocol buffer package.
6
7 It is generated from these files:
8         grpc_testing/test.proto
9
10 It has these top-level messages:
11         SimpleRequest
12         SimpleResponse
13 */
14 package grpc_testing
15
16 import proto "github.com/golang/protobuf/proto"
17 import fmt "fmt"
18 import math "math"
19
20 import (
21         context "golang.org/x/net/context"
22         grpc "google.golang.org/grpc"
23 )
24
25 // Reference imports to suppress errors if they are not otherwise used.
26 var _ = proto.Marshal
27 var _ = fmt.Errorf
28 var _ = math.Inf
29
30 // This is a compile-time assertion to ensure that this generated file
31 // is compatible with the proto package it is being compiled against.
32 // A compilation error at this line likely means your copy of the
33 // proto package needs to be updated.
34 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
35
36 type SimpleRequest struct {
37         Id int32 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"`
38 }
39
40 func (m *SimpleRequest) Reset()                    { *m = SimpleRequest{} }
41 func (m *SimpleRequest) String() string            { return proto.CompactTextString(m) }
42 func (*SimpleRequest) ProtoMessage()               {}
43 func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
44
45 func (m *SimpleRequest) GetId() int32 {
46         if m != nil {
47                 return m.Id
48         }
49         return 0
50 }
51
52 type SimpleResponse struct {
53         Id int32 `protobuf:"varint,3,opt,name=id" json:"id,omitempty"`
54 }
55
56 func (m *SimpleResponse) Reset()                    { *m = SimpleResponse{} }
57 func (m *SimpleResponse) String() string            { return proto.CompactTextString(m) }
58 func (*SimpleResponse) ProtoMessage()               {}
59 func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
60
61 func (m *SimpleResponse) GetId() int32 {
62         if m != nil {
63                 return m.Id
64         }
65         return 0
66 }
67
68 func init() {
69         proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest")
70         proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse")
71 }
72
73 // Reference imports to suppress errors if they are not otherwise used.
74 var _ context.Context
75 var _ grpc.ClientConn
76
77 // This is a compile-time assertion to ensure that this generated file
78 // is compatible with the grpc package it is being compiled against.
79 const _ = grpc.SupportPackageIsVersion4
80
81 // Client API for TestService service
82
83 type TestServiceClient interface {
84         // One request followed by one response.
85         // The server returns the client id as-is.
86         UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error)
87         // A sequence of requests with each request served by the server immediately.
88         // As one request could lead to multiple responses, this interface
89         // demonstrates the idea of full duplexing.
90         FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error)
91         // Client stream
92         ClientStreamCall(ctx context.Context, opts ...grpc.CallOption) (TestService_ClientStreamCallClient, error)
93         // Server stream
94         ServerStreamCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (TestService_ServerStreamCallClient, error)
95 }
96
97 type testServiceClient struct {
98         cc *grpc.ClientConn
99 }
100
101 func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient {
102         return &testServiceClient{cc}
103 }
104
105 func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) {
106         out := new(SimpleResponse)
107         err := grpc.Invoke(ctx, "/grpc.testing.TestService/UnaryCall", in, out, c.cc, opts...)
108         if err != nil {
109                 return nil, err
110         }
111         return out, nil
112 }
113
114 func (c *testServiceClient) FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) {
115         stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/grpc.testing.TestService/FullDuplexCall", opts...)
116         if err != nil {
117                 return nil, err
118         }
119         x := &testServiceFullDuplexCallClient{stream}
120         return x, nil
121 }
122
123 type TestService_FullDuplexCallClient interface {
124         Send(*SimpleRequest) error
125         Recv() (*SimpleResponse, error)
126         grpc.ClientStream
127 }
128
129 type testServiceFullDuplexCallClient struct {
130         grpc.ClientStream
131 }
132
133 func (x *testServiceFullDuplexCallClient) Send(m *SimpleRequest) error {
134         return x.ClientStream.SendMsg(m)
135 }
136
137 func (x *testServiceFullDuplexCallClient) Recv() (*SimpleResponse, error) {
138         m := new(SimpleResponse)
139         if err := x.ClientStream.RecvMsg(m); err != nil {
140                 return nil, err
141         }
142         return m, nil
143 }
144
145 func (c *testServiceClient) ClientStreamCall(ctx context.Context, opts ...grpc.CallOption) (TestService_ClientStreamCallClient, error) {
146         stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[1], c.cc, "/grpc.testing.TestService/ClientStreamCall", opts...)
147         if err != nil {
148                 return nil, err
149         }
150         x := &testServiceClientStreamCallClient{stream}
151         return x, nil
152 }
153
154 type TestService_ClientStreamCallClient interface {
155         Send(*SimpleRequest) error
156         CloseAndRecv() (*SimpleResponse, error)
157         grpc.ClientStream
158 }
159
160 type testServiceClientStreamCallClient struct {
161         grpc.ClientStream
162 }
163
164 func (x *testServiceClientStreamCallClient) Send(m *SimpleRequest) error {
165         return x.ClientStream.SendMsg(m)
166 }
167
168 func (x *testServiceClientStreamCallClient) CloseAndRecv() (*SimpleResponse, error) {
169         if err := x.ClientStream.CloseSend(); err != nil {
170                 return nil, err
171         }
172         m := new(SimpleResponse)
173         if err := x.ClientStream.RecvMsg(m); err != nil {
174                 return nil, err
175         }
176         return m, nil
177 }
178
179 func (c *testServiceClient) ServerStreamCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (TestService_ServerStreamCallClient, error) {
180         stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[2], c.cc, "/grpc.testing.TestService/ServerStreamCall", opts...)
181         if err != nil {
182                 return nil, err
183         }
184         x := &testServiceServerStreamCallClient{stream}
185         if err := x.ClientStream.SendMsg(in); err != nil {
186                 return nil, err
187         }
188         if err := x.ClientStream.CloseSend(); err != nil {
189                 return nil, err
190         }
191         return x, nil
192 }
193
194 type TestService_ServerStreamCallClient interface {
195         Recv() (*SimpleResponse, error)
196         grpc.ClientStream
197 }
198
199 type testServiceServerStreamCallClient struct {
200         grpc.ClientStream
201 }
202
203 func (x *testServiceServerStreamCallClient) Recv() (*SimpleResponse, error) {
204         m := new(SimpleResponse)
205         if err := x.ClientStream.RecvMsg(m); err != nil {
206                 return nil, err
207         }
208         return m, nil
209 }
210
211 // Server API for TestService service
212
213 type TestServiceServer interface {
214         // One request followed by one response.
215         // The server returns the client id as-is.
216         UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
217         // A sequence of requests with each request served by the server immediately.
218         // As one request could lead to multiple responses, this interface
219         // demonstrates the idea of full duplexing.
220         FullDuplexCall(TestService_FullDuplexCallServer) error
221         // Client stream
222         ClientStreamCall(TestService_ClientStreamCallServer) error
223         // Server stream
224         ServerStreamCall(*SimpleRequest, TestService_ServerStreamCallServer) error
225 }
226
227 func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) {
228         s.RegisterService(&_TestService_serviceDesc, srv)
229 }
230
231 func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
232         in := new(SimpleRequest)
233         if err := dec(in); err != nil {
234                 return nil, err
235         }
236         if interceptor == nil {
237                 return srv.(TestServiceServer).UnaryCall(ctx, in)
238         }
239         info := &grpc.UnaryServerInfo{
240                 Server:     srv,
241                 FullMethod: "/grpc.testing.TestService/UnaryCall",
242         }
243         handler := func(ctx context.Context, req interface{}) (interface{}, error) {
244                 return srv.(TestServiceServer).UnaryCall(ctx, req.(*SimpleRequest))
245         }
246         return interceptor(ctx, in, info, handler)
247 }
248
249 func _TestService_FullDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error {
250         return srv.(TestServiceServer).FullDuplexCall(&testServiceFullDuplexCallServer{stream})
251 }
252
253 type TestService_FullDuplexCallServer interface {
254         Send(*SimpleResponse) error
255         Recv() (*SimpleRequest, error)
256         grpc.ServerStream
257 }
258
259 type testServiceFullDuplexCallServer struct {
260         grpc.ServerStream
261 }
262
263 func (x *testServiceFullDuplexCallServer) Send(m *SimpleResponse) error {
264         return x.ServerStream.SendMsg(m)
265 }
266
267 func (x *testServiceFullDuplexCallServer) Recv() (*SimpleRequest, error) {
268         m := new(SimpleRequest)
269         if err := x.ServerStream.RecvMsg(m); err != nil {
270                 return nil, err
271         }
272         return m, nil
273 }
274
275 func _TestService_ClientStreamCall_Handler(srv interface{}, stream grpc.ServerStream) error {
276         return srv.(TestServiceServer).ClientStreamCall(&testServiceClientStreamCallServer{stream})
277 }
278
279 type TestService_ClientStreamCallServer interface {
280         SendAndClose(*SimpleResponse) error
281         Recv() (*SimpleRequest, error)
282         grpc.ServerStream
283 }
284
285 type testServiceClientStreamCallServer struct {
286         grpc.ServerStream
287 }
288
289 func (x *testServiceClientStreamCallServer) SendAndClose(m *SimpleResponse) error {
290         return x.ServerStream.SendMsg(m)
291 }
292
293 func (x *testServiceClientStreamCallServer) Recv() (*SimpleRequest, error) {
294         m := new(SimpleRequest)
295         if err := x.ServerStream.RecvMsg(m); err != nil {
296                 return nil, err
297         }
298         return m, nil
299 }
300
301 func _TestService_ServerStreamCall_Handler(srv interface{}, stream grpc.ServerStream) error {
302         m := new(SimpleRequest)
303         if err := stream.RecvMsg(m); err != nil {
304                 return err
305         }
306         return srv.(TestServiceServer).ServerStreamCall(m, &testServiceServerStreamCallServer{stream})
307 }
308
309 type TestService_ServerStreamCallServer interface {
310         Send(*SimpleResponse) error
311         grpc.ServerStream
312 }
313
314 type testServiceServerStreamCallServer struct {
315         grpc.ServerStream
316 }
317
318 func (x *testServiceServerStreamCallServer) Send(m *SimpleResponse) error {
319         return x.ServerStream.SendMsg(m)
320 }
321
322 var _TestService_serviceDesc = grpc.ServiceDesc{
323         ServiceName: "grpc.testing.TestService",
324         HandlerType: (*TestServiceServer)(nil),
325         Methods: []grpc.MethodDesc{
326                 {
327                         MethodName: "UnaryCall",
328                         Handler:    _TestService_UnaryCall_Handler,
329                 },
330         },
331         Streams: []grpc.StreamDesc{
332                 {
333                         StreamName:    "FullDuplexCall",
334                         Handler:       _TestService_FullDuplexCall_Handler,
335                         ServerStreams: true,
336                         ClientStreams: true,
337                 },
338                 {
339                         StreamName:    "ClientStreamCall",
340                         Handler:       _TestService_ClientStreamCall_Handler,
341                         ClientStreams: true,
342                 },
343                 {
344                         StreamName:    "ServerStreamCall",
345                         Handler:       _TestService_ServerStreamCall_Handler,
346                         ServerStreams: true,
347                 },
348         },
349         Metadata: "grpc_testing/test.proto",
350 }
351
352 func init() { proto.RegisterFile("grpc_testing/test.proto", fileDescriptor0) }
353
354 var fileDescriptor0 = []byte{
355         // 202 bytes of a gzipped FileDescriptorProto
356         0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0x2f, 0x2a, 0x48,
357         0x8e, 0x2f, 0x49, 0x2d, 0x2e, 0xc9, 0xcc, 0x4b, 0xd7, 0x07, 0xd1, 0x7a, 0x05, 0x45, 0xf9, 0x25,
358         0xf9, 0x42, 0x3c, 0x20, 0x09, 0x3d, 0xa8, 0x84, 0x92, 0x3c, 0x17, 0x6f, 0x70, 0x66, 0x6e, 0x41,
359         0x4e, 0x6a, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x10, 0x1f, 0x17, 0x53, 0x66, 0x8a, 0x04,
360         0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x53, 0x66, 0x8a, 0x92, 0x02, 0x17, 0x1f, 0x4c, 0x41, 0x71,
361         0x41, 0x7e, 0x5e, 0x71, 0x2a, 0x54, 0x05, 0x33, 0x4c, 0x85, 0xd1, 0x09, 0x26, 0x2e, 0xee, 0x90,
362         0xd4, 0xe2, 0x92, 0xe0, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0x54, 0x21, 0x37, 0x2e, 0xce, 0xd0, 0xbc,
363         0xc4, 0xa2, 0x4a, 0xe7, 0xc4, 0x9c, 0x1c, 0x21, 0x69, 0x3d, 0x64, 0xeb, 0xf4, 0x50, 0xec, 0x92,
364         0x92, 0xc1, 0x2e, 0x09, 0xb5, 0xc7, 0x9f, 0x8b, 0xcf, 0xad, 0x34, 0x27, 0xc7, 0xa5, 0xb4, 0x20,
365         0x27, 0xb5, 0x82, 0x42, 0xc3, 0x34, 0x18, 0x0d, 0x18, 0x85, 0xfc, 0xb9, 0x04, 0x9c, 0x73, 0x32,
366         0x53, 0xf3, 0x4a, 0x82, 0x4b, 0x8a, 0x52, 0x13, 0x73, 0x29, 0x36, 0x12, 0x64, 0x20, 0xc8, 0xd3,
367         0xa9, 0x45, 0x54, 0x31, 0xd0, 0x80, 0x31, 0x89, 0x0d, 0x1c, 0x45, 0xc6, 0x80, 0x00, 0x00, 0x00,
368         0xff, 0xff, 0x4c, 0x43, 0x27, 0x67, 0xbd, 0x01, 0x00, 0x00,
369 }