...

Source file src/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go

Documentation: go.opentelemetry.io/proto/otlp/collector/metrics/v1

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.1.0
     4  // - protoc             v3.21.6
     5  // source: opentelemetry/proto/collector/metrics/v1/metrics_service.proto
     6  
     7  package v1
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the grpc package it is being compiled against.
    18  // Requires gRPC-Go v1.32.0 or later.
    19  const _ = grpc.SupportPackageIsVersion7
    20  
    21  // MetricsServiceClient is the client API for MetricsService service.
    22  //
    23  // 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.
    24  type MetricsServiceClient interface {
    25  	// For performance reasons, it is recommended to keep this RPC
    26  	// alive for the entire life of the application.
    27  	Export(ctx context.Context, in *ExportMetricsServiceRequest, opts ...grpc.CallOption) (*ExportMetricsServiceResponse, error)
    28  }
    29  
    30  type metricsServiceClient struct {
    31  	cc grpc.ClientConnInterface
    32  }
    33  
    34  func NewMetricsServiceClient(cc grpc.ClientConnInterface) MetricsServiceClient {
    35  	return &metricsServiceClient{cc}
    36  }
    37  
    38  func (c *metricsServiceClient) Export(ctx context.Context, in *ExportMetricsServiceRequest, opts ...grpc.CallOption) (*ExportMetricsServiceResponse, error) {
    39  	out := new(ExportMetricsServiceResponse)
    40  	err := c.cc.Invoke(ctx, "/opentelemetry.proto.collector.metrics.v1.MetricsService/Export", in, out, opts...)
    41  	if err != nil {
    42  		return nil, err
    43  	}
    44  	return out, nil
    45  }
    46  
    47  // MetricsServiceServer is the server API for MetricsService service.
    48  // All implementations must embed UnimplementedMetricsServiceServer
    49  // for forward compatibility
    50  type MetricsServiceServer interface {
    51  	// For performance reasons, it is recommended to keep this RPC
    52  	// alive for the entire life of the application.
    53  	Export(context.Context, *ExportMetricsServiceRequest) (*ExportMetricsServiceResponse, error)
    54  	mustEmbedUnimplementedMetricsServiceServer()
    55  }
    56  
    57  // UnimplementedMetricsServiceServer must be embedded to have forward compatible implementations.
    58  type UnimplementedMetricsServiceServer struct {
    59  }
    60  
    61  func (UnimplementedMetricsServiceServer) Export(context.Context, *ExportMetricsServiceRequest) (*ExportMetricsServiceResponse, error) {
    62  	return nil, status.Errorf(codes.Unimplemented, "method Export not implemented")
    63  }
    64  func (UnimplementedMetricsServiceServer) mustEmbedUnimplementedMetricsServiceServer() {}
    65  
    66  // UnsafeMetricsServiceServer may be embedded to opt out of forward compatibility for this service.
    67  // Use of this interface is not recommended, as added methods to MetricsServiceServer will
    68  // result in compilation errors.
    69  type UnsafeMetricsServiceServer interface {
    70  	mustEmbedUnimplementedMetricsServiceServer()
    71  }
    72  
    73  func RegisterMetricsServiceServer(s grpc.ServiceRegistrar, srv MetricsServiceServer) {
    74  	s.RegisterService(&MetricsService_ServiceDesc, srv)
    75  }
    76  
    77  func _MetricsService_Export_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    78  	in := new(ExportMetricsServiceRequest)
    79  	if err := dec(in); err != nil {
    80  		return nil, err
    81  	}
    82  	if interceptor == nil {
    83  		return srv.(MetricsServiceServer).Export(ctx, in)
    84  	}
    85  	info := &grpc.UnaryServerInfo{
    86  		Server:     srv,
    87  		FullMethod: "/opentelemetry.proto.collector.metrics.v1.MetricsService/Export",
    88  	}
    89  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
    90  		return srv.(MetricsServiceServer).Export(ctx, req.(*ExportMetricsServiceRequest))
    91  	}
    92  	return interceptor(ctx, in, info, handler)
    93  }
    94  
    95  // MetricsService_ServiceDesc is the grpc.ServiceDesc for MetricsService service.
    96  // It's only intended for direct use with grpc.RegisterService,
    97  // and not to be introspected or modified (even as a copy)
    98  var MetricsService_ServiceDesc = grpc.ServiceDesc{
    99  	ServiceName: "opentelemetry.proto.collector.metrics.v1.MetricsService",
   100  	HandlerType: (*MetricsServiceServer)(nil),
   101  	Methods: []grpc.MethodDesc{
   102  		{
   103  			MethodName: "Export",
   104  			Handler:    _MetricsService_Export_Handler,
   105  		},
   106  	},
   107  	Streams:  []grpc.StreamDesc{},
   108  	Metadata: "opentelemetry/proto/collector/metrics/v1/metrics_service.proto",
   109  }
   110  

View as plain text