1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: metrics.proto
5 Package grpc_testing is a generated protocol buffer package.
7 It is generated from these files:
10 It has these top-level messages:
17 import proto "github.com/golang/protobuf/proto"
22 context "golang.org/x/net/context"
23 grpc "google.golang.org/grpc"
26 // Reference imports to suppress errors if they are not otherwise used.
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
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"`
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} }
52 type isGaugeResponse_Value interface {
53 isGaugeResponse_Value()
56 type GaugeResponse_LongValue struct {
57 LongValue int64 `protobuf:"varint,2,opt,name=long_value,json=longValue,oneof"`
59 type GaugeResponse_DoubleValue struct {
60 DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"`
62 type GaugeResponse_StringValue struct {
63 StringValue string `protobuf:"bytes,4,opt,name=string_value,json=stringValue,oneof"`
66 func (*GaugeResponse_LongValue) isGaugeResponse_Value() {}
67 func (*GaugeResponse_DoubleValue) isGaugeResponse_Value() {}
68 func (*GaugeResponse_StringValue) isGaugeResponse_Value() {}
70 func (m *GaugeResponse) GetValue() isGaugeResponse_Value {
77 func (m *GaugeResponse) GetName() string {
84 func (m *GaugeResponse) GetLongValue() int64 {
85 if x, ok := m.GetValue().(*GaugeResponse_LongValue); ok {
91 func (m *GaugeResponse) GetDoubleValue() float64 {
92 if x, ok := m.GetValue().(*GaugeResponse_DoubleValue); ok {
98 func (m *GaugeResponse) GetStringValue() string {
99 if x, ok := m.GetValue().(*GaugeResponse_StringValue); ok {
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),
114 func _GaugeResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
115 m := msg.(*GaugeResponse)
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)
129 return fmt.Errorf("GaugeResponse.Value has unexpected type %T", x)
134 func _GaugeResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
135 m := msg.(*GaugeResponse)
137 case 2: // value.long_value
138 if wire != proto.WireVarint {
139 return true, proto.ErrInternalBadWireType
141 x, err := b.DecodeVarint()
142 m.Value = &GaugeResponse_LongValue{int64(x)}
144 case 3: // value.double_value
145 if wire != proto.WireFixed64 {
146 return true, proto.ErrInternalBadWireType
148 x, err := b.DecodeFixed64()
149 m.Value = &GaugeResponse_DoubleValue{math.Float64frombits(x)}
151 case 4: // value.string_value
152 if wire != proto.WireBytes {
153 return true, proto.ErrInternalBadWireType
155 x, err := b.DecodeStringBytes()
156 m.Value = &GaugeResponse_StringValue{x}
163 func _GaugeResponse_OneofSizer(msg proto.Message) (n int) {
164 m := msg.(*GaugeResponse)
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)
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)
179 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
184 // Request message containing the gauge name
185 type GaugeRequest struct {
186 Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
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} }
194 func (m *GaugeRequest) GetName() string {
201 type EmptyMessage struct {
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} }
210 proto.RegisterType((*GaugeResponse)(nil), "grpc.testing.GaugeResponse")
211 proto.RegisterType((*GaugeRequest)(nil), "grpc.testing.GaugeRequest")
212 proto.RegisterType((*EmptyMessage)(nil), "grpc.testing.EmptyMessage")
215 // Reference imports to suppress errors if they are not otherwise used.
216 var _ context.Context
217 var _ grpc.ClientConn
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
223 // Client API for MetricsService service
225 type MetricsServiceClient interface {
226 // Returns the values of all the gauges that are currently being maintained by
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)
233 type metricsServiceClient struct {
237 func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient {
238 return &metricsServiceClient{cc}
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...)
246 x := &metricsServiceGetAllGaugesClient{stream}
247 if err := x.ClientStream.SendMsg(in); err != nil {
250 if err := x.ClientStream.CloseSend(); err != nil {
256 type MetricsService_GetAllGaugesClient interface {
257 Recv() (*GaugeResponse, error)
261 type metricsServiceGetAllGaugesClient struct {
265 func (x *metricsServiceGetAllGaugesClient) Recv() (*GaugeResponse, error) {
266 m := new(GaugeResponse)
267 if err := x.ClientStream.RecvMsg(m); err != nil {
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...)
282 // Server API for MetricsService service
284 type MetricsServiceServer interface {
285 // Returns the values of all the gauges that are currently being maintained by
287 GetAllGauges(*EmptyMessage, MetricsService_GetAllGaugesServer) error
288 // Returns the value of one gauge
289 GetGauge(context.Context, *GaugeRequest) (*GaugeResponse, error)
292 func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) {
293 s.RegisterService(&_MetricsService_serviceDesc, srv)
296 func _MetricsService_GetAllGauges_Handler(srv interface{}, stream grpc.ServerStream) error {
297 m := new(EmptyMessage)
298 if err := stream.RecvMsg(m); err != nil {
301 return srv.(MetricsServiceServer).GetAllGauges(m, &metricsServiceGetAllGaugesServer{stream})
304 type MetricsService_GetAllGaugesServer interface {
305 Send(*GaugeResponse) error
309 type metricsServiceGetAllGaugesServer struct {
313 func (x *metricsServiceGetAllGaugesServer) Send(m *GaugeResponse) error {
314 return x.ServerStream.SendMsg(m)
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 {
322 if interceptor == nil {
323 return srv.(MetricsServiceServer).GetGauge(ctx, in)
325 info := &grpc.UnaryServerInfo{
327 FullMethod: "/grpc.testing.MetricsService/GetGauge",
329 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
330 return srv.(MetricsServiceServer).GetGauge(ctx, req.(*GaugeRequest))
332 return interceptor(ctx, in, info, handler)
335 var _MetricsService_serviceDesc = grpc.ServiceDesc{
336 ServiceName: "grpc.testing.MetricsService",
337 HandlerType: (*MetricsServiceServer)(nil),
338 Methods: []grpc.MethodDesc{
340 MethodName: "GetGauge",
341 Handler: _MetricsService_GetGauge_Handler,
344 Streams: []grpc.StreamDesc{
346 StreamName: "GetAllGauges",
347 Handler: _MetricsService_GetAllGauges_Handler,
351 Metadata: "metrics.proto",
354 func init() { proto.RegisterFile("metrics.proto", fileDescriptor0) }
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,