You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

434 lines
14 KiB

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