OSDN Git Service

new repo
[bytom/vapor.git] / vendor / google.golang.org / grpc / stress / grpc_testing / metrics.pb.go
1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: metrics.proto
3
4 /*
5 Package grpc_testing is a generated protocol buffer package.
6
7 It is generated from these files:
8         metrics.proto
9
10 It has these top-level messages:
11         GaugeResponse
12         GaugeRequest
13         EmptyMessage
14 */
15 package grpc_testing
16
17 import proto "github.com/golang/protobuf/proto"
18 import fmt "fmt"
19 import math "math"
20
21 import (
22         context "golang.org/x/net/context"
23         grpc "google.golang.org/grpc"
24 )
25
26 // Reference imports to suppress errors if they are not otherwise used.
27 var _ = proto.Marshal
28 var _ = fmt.Errorf
29 var _ = math.Inf
30
31 // This is a compile-time assertion to ensure that this generated file
32 // is compatible with the proto package it is being compiled against.
33 // A compilation error at this line likely means your copy of the
34 // proto package needs to be updated.
35 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
36
37 // Response message containing the gauge name and value
38 type GaugeResponse struct {
39         Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
40         // Types that are valid to be assigned to Value:
41         //      *GaugeResponse_LongValue
42         //      *GaugeResponse_DoubleValue
43         //      *GaugeResponse_StringValue
44         Value isGaugeResponse_Value `protobuf_oneof:"value"`
45 }
46
47 func (m *GaugeResponse) Reset()                    { *m = GaugeResponse{} }
48 func (m *GaugeResponse) String() string            { return proto.CompactTextString(m) }
49 func (*GaugeResponse) ProtoMessage()               {}
50 func (*GaugeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
51
52 type isGaugeResponse_Value interface {
53         isGaugeResponse_Value()
54 }
55
56 type GaugeResponse_LongValue struct {
57         LongValue int64 `protobuf:"varint,2,opt,name=long_value,json=longValue,oneof"`
58 }
59 type GaugeResponse_DoubleValue struct {
60         DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"`
61 }
62 type GaugeResponse_StringValue struct {
63         StringValue string `protobuf:"bytes,4,opt,name=string_value,json=stringValue,oneof"`
64 }
65
66 func (*GaugeResponse_LongValue) isGaugeResponse_Value()   {}
67 func (*GaugeResponse_DoubleValue) isGaugeResponse_Value() {}
68 func (*GaugeResponse_StringValue) isGaugeResponse_Value() {}
69
70 func (m *GaugeResponse) GetValue() isGaugeResponse_Value {
71         if m != nil {
72                 return m.Value
73         }
74         return nil
75 }
76
77 func (m *GaugeResponse) GetName() string {
78         if m != nil {
79                 return m.Name
80         }
81         return ""
82 }
83
84 func (m *GaugeResponse) GetLongValue() int64 {
85         if x, ok := m.GetValue().(*GaugeResponse_LongValue); ok {
86                 return x.LongValue
87         }
88         return 0
89 }
90
91 func (m *GaugeResponse) GetDoubleValue() float64 {
92         if x, ok := m.GetValue().(*GaugeResponse_DoubleValue); ok {
93                 return x.DoubleValue
94         }
95         return 0
96 }
97
98 func (m *GaugeResponse) GetStringValue() string {
99         if x, ok := m.GetValue().(*GaugeResponse_StringValue); ok {
100                 return x.StringValue
101         }
102         return ""
103 }
104
105 // XXX_OneofFuncs is for the internal use of the proto package.
106 func (*GaugeResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
107         return _GaugeResponse_OneofMarshaler, _GaugeResponse_OneofUnmarshaler, _GaugeResponse_OneofSizer, []interface{}{
108                 (*GaugeResponse_LongValue)(nil),
109                 (*GaugeResponse_DoubleValue)(nil),
110                 (*GaugeResponse_StringValue)(nil),
111         }
112 }
113
114 func _GaugeResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
115         m := msg.(*GaugeResponse)
116         // value
117         switch x := m.Value.(type) {
118         case *GaugeResponse_LongValue:
119                 b.EncodeVarint(2<<3 | proto.WireVarint)
120                 b.EncodeVarint(uint64(x.LongValue))
121         case *GaugeResponse_DoubleValue:
122                 b.EncodeVarint(3<<3 | proto.WireFixed64)
123                 b.EncodeFixed64(math.Float64bits(x.DoubleValue))
124         case *GaugeResponse_StringValue:
125                 b.EncodeVarint(4<<3 | proto.WireBytes)
126                 b.EncodeStringBytes(x.StringValue)
127         case nil:
128         default:
129                 return fmt.Errorf("GaugeResponse.Value has unexpected type %T", x)
130         }
131         return nil
132 }
133
134 func _GaugeResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
135         m := msg.(*GaugeResponse)
136         switch tag {
137         case 2: // value.long_value
138                 if wire != proto.WireVarint {
139                         return true, proto.ErrInternalBadWireType
140                 }
141                 x, err := b.DecodeVarint()
142                 m.Value = &GaugeResponse_LongValue{int64(x)}
143                 return true, err
144         case 3: // value.double_value
145                 if wire != proto.WireFixed64 {
146                         return true, proto.ErrInternalBadWireType
147                 }
148                 x, err := b.DecodeFixed64()
149                 m.Value = &GaugeResponse_DoubleValue{math.Float64frombits(x)}
150                 return true, err
151         case 4: // value.string_value
152                 if wire != proto.WireBytes {
153                         return true, proto.ErrInternalBadWireType
154                 }
155                 x, err := b.DecodeStringBytes()
156                 m.Value = &GaugeResponse_StringValue{x}
157                 return true, err
158         default:
159                 return false, nil
160         }
161 }
162
163 func _GaugeResponse_OneofSizer(msg proto.Message) (n int) {
164         m := msg.(*GaugeResponse)
165         // value
166         switch x := m.Value.(type) {
167         case *GaugeResponse_LongValue:
168                 n += proto.SizeVarint(2<<3 | proto.WireVarint)
169                 n += proto.SizeVarint(uint64(x.LongValue))
170         case *GaugeResponse_DoubleValue:
171                 n += proto.SizeVarint(3<<3 | proto.WireFixed64)
172                 n += 8
173         case *GaugeResponse_StringValue:
174                 n += proto.SizeVarint(4<<3 | proto.WireBytes)
175                 n += proto.SizeVarint(uint64(len(x.StringValue)))
176                 n += len(x.StringValue)
177         case nil:
178         default:
179                 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
180         }
181         return n
182 }
183
184 // Request message containing the gauge name
185 type GaugeRequest struct {
186         Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
187 }
188
189 func (m *GaugeRequest) Reset()                    { *m = GaugeRequest{} }
190 func (m *GaugeRequest) String() string            { return proto.CompactTextString(m) }
191 func (*GaugeRequest) ProtoMessage()               {}
192 func (*GaugeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
193
194 func (m *GaugeRequest) GetName() string {
195         if m != nil {
196                 return m.Name
197         }
198         return ""
199 }
200
201 type EmptyMessage struct {
202 }
203
204 func (m *EmptyMessage) Reset()                    { *m = EmptyMessage{} }
205 func (m *EmptyMessage) String() string            { return proto.CompactTextString(m) }
206 func (*EmptyMessage) ProtoMessage()               {}
207 func (*EmptyMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
208
209 func init() {
210         proto.RegisterType((*GaugeResponse)(nil), "grpc.testing.GaugeResponse")
211         proto.RegisterType((*GaugeRequest)(nil), "grpc.testing.GaugeRequest")
212         proto.RegisterType((*EmptyMessage)(nil), "grpc.testing.EmptyMessage")
213 }
214
215 // Reference imports to suppress errors if they are not otherwise used.
216 var _ context.Context
217 var _ grpc.ClientConn
218
219 // This is a compile-time assertion to ensure that this generated file
220 // is compatible with the grpc package it is being compiled against.
221 const _ = grpc.SupportPackageIsVersion4
222
223 // Client API for MetricsService service
224
225 type MetricsServiceClient interface {
226         // Returns the values of all the gauges that are currently being maintained by
227         // the service
228         GetAllGauges(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (MetricsService_GetAllGaugesClient, error)
229         // Returns the value of one gauge
230         GetGauge(ctx context.Context, in *GaugeRequest, opts ...grpc.CallOption) (*GaugeResponse, error)
231 }
232
233 type metricsServiceClient struct {
234         cc *grpc.ClientConn
235 }
236
237 func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient {
238         return &metricsServiceClient{cc}
239 }
240
241 func (c *metricsServiceClient) GetAllGauges(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (MetricsService_GetAllGaugesClient, error) {
242         stream, err := grpc.NewClientStream(ctx, &_MetricsService_serviceDesc.Streams[0], c.cc, "/grpc.testing.MetricsService/GetAllGauges", opts...)
243         if err != nil {
244                 return nil, err
245         }
246         x := &metricsServiceGetAllGaugesClient{stream}
247         if err := x.ClientStream.SendMsg(in); err != nil {
248                 return nil, err
249         }
250         if err := x.ClientStream.CloseSend(); err != nil {
251                 return nil, err
252         }
253         return x, nil
254 }
255
256 type MetricsService_GetAllGaugesClient interface {
257         Recv() (*GaugeResponse, error)
258         grpc.ClientStream
259 }
260
261 type metricsServiceGetAllGaugesClient struct {
262         grpc.ClientStream
263 }
264
265 func (x *metricsServiceGetAllGaugesClient) Recv() (*GaugeResponse, error) {
266         m := new(GaugeResponse)
267         if err := x.ClientStream.RecvMsg(m); err != nil {
268                 return nil, err
269         }
270         return m, nil
271 }
272
273 func (c *metricsServiceClient) GetGauge(ctx context.Context, in *GaugeRequest, opts ...grpc.CallOption) (*GaugeResponse, error) {
274         out := new(GaugeResponse)
275         err := grpc.Invoke(ctx, "/grpc.testing.MetricsService/GetGauge", in, out, c.cc, opts...)
276         if err != nil {
277                 return nil, err
278         }
279         return out, nil
280 }
281
282 // Server API for MetricsService service
283
284 type MetricsServiceServer interface {
285         // Returns the values of all the gauges that are currently being maintained by
286         // the service
287         GetAllGauges(*EmptyMessage, MetricsService_GetAllGaugesServer) error
288         // Returns the value of one gauge
289         GetGauge(context.Context, *GaugeRequest) (*GaugeResponse, error)
290 }
291
292 func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) {
293         s.RegisterService(&_MetricsService_serviceDesc, srv)
294 }
295
296 func _MetricsService_GetAllGauges_Handler(srv interface{}, stream grpc.ServerStream) error {
297         m := new(EmptyMessage)
298         if err := stream.RecvMsg(m); err != nil {
299                 return err
300         }
301         return srv.(MetricsServiceServer).GetAllGauges(m, &metricsServiceGetAllGaugesServer{stream})
302 }
303
304 type MetricsService_GetAllGaugesServer interface {
305         Send(*GaugeResponse) error
306         grpc.ServerStream
307 }
308
309 type metricsServiceGetAllGaugesServer struct {
310         grpc.ServerStream
311 }
312
313 func (x *metricsServiceGetAllGaugesServer) Send(m *GaugeResponse) error {
314         return x.ServerStream.SendMsg(m)
315 }
316
317 func _MetricsService_GetGauge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
318         in := new(GaugeRequest)
319         if err := dec(in); err != nil {
320                 return nil, err
321         }
322         if interceptor == nil {
323                 return srv.(MetricsServiceServer).GetGauge(ctx, in)
324         }
325         info := &grpc.UnaryServerInfo{
326                 Server:     srv,
327                 FullMethod: "/grpc.testing.MetricsService/GetGauge",
328         }
329         handler := func(ctx context.Context, req interface{}) (interface{}, error) {
330                 return srv.(MetricsServiceServer).GetGauge(ctx, req.(*GaugeRequest))
331         }
332         return interceptor(ctx, in, info, handler)
333 }
334
335 var _MetricsService_serviceDesc = grpc.ServiceDesc{
336         ServiceName: "grpc.testing.MetricsService",
337         HandlerType: (*MetricsServiceServer)(nil),
338         Methods: []grpc.MethodDesc{
339                 {
340                         MethodName: "GetGauge",
341                         Handler:    _MetricsService_GetGauge_Handler,
342                 },
343         },
344         Streams: []grpc.StreamDesc{
345                 {
346                         StreamName:    "GetAllGauges",
347                         Handler:       _MetricsService_GetAllGauges_Handler,
348                         ServerStreams: true,
349                 },
350         },
351         Metadata: "metrics.proto",
352 }
353
354 func init() { proto.RegisterFile("metrics.proto", fileDescriptor0) }
355
356 var fileDescriptor0 = []byte{
357         // 256 bytes of a gzipped FileDescriptorProto
358         0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x3f, 0x4f, 0xc3, 0x30,
359         0x10, 0xc5, 0x6b, 0x5a, 0xfe, 0xf4, 0x70, 0x3b, 0x78, 0xaa, 0xca, 0x40, 0x14, 0x96, 0x4c, 0x11,
360         0x82, 0x4f, 0x00, 0x08, 0xa5, 0x0c, 0x5d, 0x82, 0xc4, 0x8a, 0xd2, 0x70, 0xb2, 0x22, 0x39, 0x71,
361         0xf0, 0x5d, 0x2a, 0xf1, 0x49, 0x58, 0xf9, 0xa8, 0xc8, 0x4e, 0x55, 0xa5, 0x08, 0x75, 0xb3, 0x7e,
362         0xf7, 0xfc, 0xfc, 0x9e, 0x0f, 0x66, 0x35, 0xb2, 0xab, 0x4a, 0x4a, 0x5b, 0x67, 0xd9, 0x2a, 0xa9,
363         0x5d, 0x5b, 0xa6, 0x8c, 0xc4, 0x55, 0xa3, 0xe3, 0x6f, 0x01, 0xb3, 0xac, 0xe8, 0x34, 0xe6, 0x48,
364         0xad, 0x6d, 0x08, 0x95, 0x82, 0x49, 0x53, 0xd4, 0xb8, 0x10, 0x91, 0x48, 0xa6, 0x79, 0x38, 0xab,
365         0x6b, 0x00, 0x63, 0x1b, 0xfd, 0xbe, 0x2d, 0x4c, 0x87, 0x8b, 0x93, 0x48, 0x24, 0xe3, 0xd5, 0x28,
366         0x9f, 0x7a, 0xf6, 0xe6, 0x91, 0xba, 0x01, 0xf9, 0x61, 0xbb, 0x8d, 0xc1, 0x9d, 0x64, 0x1c, 0x89,
367         0x44, 0xac, 0x46, 0xf9, 0x65, 0x4f, 0xf7, 0x22, 0x62, 0x57, 0xed, 0x7d, 0x26, 0xfe, 0x05, 0x2f,
368         0xea, 0x69, 0x10, 0x3d, 0x9e, 0xc3, 0x69, 0x98, 0xc6, 0x31, 0xc8, 0x5d, 0xb0, 0xcf, 0x0e, 0x89,
369         0xff, 0xcb, 0x15, 0xcf, 0x41, 0x3e, 0xd7, 0x2d, 0x7f, 0xad, 0x91, 0xa8, 0xd0, 0x78, 0xf7, 0x23,
370         0x60, 0xbe, 0xee, 0xdb, 0xbe, 0xa2, 0xdb, 0x56, 0x25, 0xaa, 0x17, 0x90, 0x19, 0xf2, 0x83, 0x31,
371         0xc1, 0x8c, 0xd4, 0x32, 0x1d, 0xf6, 0x4f, 0x87, 0xd7, 0x97, 0x57, 0x87, 0xb3, 0x83, 0x7f, 0xb9,
372         0x15, 0xea, 0x09, 0x2e, 0x32, 0xe4, 0x40, 0xff, 0xda, 0x0c, 0x93, 0x1e, 0xb5, 0xd9, 0x9c, 0x85,
373         0x2d, 0xdc, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x7d, 0xb2, 0xc9, 0x96, 0x01, 0x00, 0x00,
374 }