metrics_service_grpc.pb.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package v1
  3. import (
  4. context "context"
  5. grpc "google.golang.org/grpc"
  6. codes "google.golang.org/grpc/codes"
  7. status "google.golang.org/grpc/status"
  8. )
  9. // This is a compile-time assertion to ensure that this generated file
  10. // is compatible with the grpc package it is being compiled against.
  11. const _ = grpc.SupportPackageIsVersion6
  12. // MetricsServiceClient is the client API for MetricsService service.
  13. //
  14. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
  15. type MetricsServiceClient interface {
  16. // For performance reasons, it is recommended to keep this RPC
  17. // alive for the entire life of the application.
  18. Export(ctx context.Context, opts ...grpc.CallOption) (MetricsService_ExportClient, error)
  19. }
  20. type metricsServiceClient struct {
  21. cc grpc.ClientConnInterface
  22. }
  23. func NewMetricsServiceClient(cc grpc.ClientConnInterface) MetricsServiceClient {
  24. return &metricsServiceClient{cc}
  25. }
  26. func (c *metricsServiceClient) Export(ctx context.Context, opts ...grpc.CallOption) (MetricsService_ExportClient, error) {
  27. stream, err := c.cc.NewStream(ctx, &_MetricsService_serviceDesc.Streams[0], "/opencensus.proto.agent.metrics.v1.MetricsService/Export", opts...)
  28. if err != nil {
  29. return nil, err
  30. }
  31. x := &metricsServiceExportClient{stream}
  32. return x, nil
  33. }
  34. type MetricsService_ExportClient interface {
  35. Send(*ExportMetricsServiceRequest) error
  36. Recv() (*ExportMetricsServiceResponse, error)
  37. grpc.ClientStream
  38. }
  39. type metricsServiceExportClient struct {
  40. grpc.ClientStream
  41. }
  42. func (x *metricsServiceExportClient) Send(m *ExportMetricsServiceRequest) error {
  43. return x.ClientStream.SendMsg(m)
  44. }
  45. func (x *metricsServiceExportClient) Recv() (*ExportMetricsServiceResponse, error) {
  46. m := new(ExportMetricsServiceResponse)
  47. if err := x.ClientStream.RecvMsg(m); err != nil {
  48. return nil, err
  49. }
  50. return m, nil
  51. }
  52. // MetricsServiceServer is the server API for MetricsService service.
  53. // All implementations must embed UnimplementedMetricsServiceServer
  54. // for forward compatibility
  55. type MetricsServiceServer interface {
  56. // For performance reasons, it is recommended to keep this RPC
  57. // alive for the entire life of the application.
  58. Export(MetricsService_ExportServer) error
  59. mustEmbedUnimplementedMetricsServiceServer()
  60. }
  61. // UnimplementedMetricsServiceServer must be embedded to have forward compatible implementations.
  62. type UnimplementedMetricsServiceServer struct {
  63. }
  64. func (*UnimplementedMetricsServiceServer) Export(MetricsService_ExportServer) error {
  65. return status.Errorf(codes.Unimplemented, "method Export not implemented")
  66. }
  67. func (*UnimplementedMetricsServiceServer) mustEmbedUnimplementedMetricsServiceServer() {}
  68. func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) {
  69. s.RegisterService(&_MetricsService_serviceDesc, srv)
  70. }
  71. func _MetricsService_Export_Handler(srv interface{}, stream grpc.ServerStream) error {
  72. return srv.(MetricsServiceServer).Export(&metricsServiceExportServer{stream})
  73. }
  74. type MetricsService_ExportServer interface {
  75. Send(*ExportMetricsServiceResponse) error
  76. Recv() (*ExportMetricsServiceRequest, error)
  77. grpc.ServerStream
  78. }
  79. type metricsServiceExportServer struct {
  80. grpc.ServerStream
  81. }
  82. func (x *metricsServiceExportServer) Send(m *ExportMetricsServiceResponse) error {
  83. return x.ServerStream.SendMsg(m)
  84. }
  85. func (x *metricsServiceExportServer) Recv() (*ExportMetricsServiceRequest, error) {
  86. m := new(ExportMetricsServiceRequest)
  87. if err := x.ServerStream.RecvMsg(m); err != nil {
  88. return nil, err
  89. }
  90. return m, nil
  91. }
  92. var _MetricsService_serviceDesc = grpc.ServiceDesc{
  93. ServiceName: "opencensus.proto.agent.metrics.v1.MetricsService",
  94. HandlerType: (*MetricsServiceServer)(nil),
  95. Methods: []grpc.MethodDesc{},
  96. Streams: []grpc.StreamDesc{
  97. {
  98. StreamName: "Export",
  99. Handler: _MetricsService_Export_Handler,
  100. ServerStreams: true,
  101. ClientStreams: true,
  102. },
  103. },
  104. Metadata: "opencensus/proto/agent/metrics/v1/metrics_service.proto",
  105. }