github.com/whoyao/protocol@v0.0.0-20230519045905-2d8ace718ca5/livekit/livekit_analytics_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.3.0
     4  // - protoc             v3.20.3
     5  // source: livekit_analytics.proto
     6  
     7  package livekit
     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  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    15  )
    16  
    17  // This is a compile-time assertion to ensure that this generated file
    18  // is compatible with the grpc package it is being compiled against.
    19  // Requires gRPC-Go v1.32.0 or later.
    20  const _ = grpc.SupportPackageIsVersion7
    21  
    22  const (
    23  	AnalyticsRecorderService_IngestStats_FullMethodName  = "/livekit.AnalyticsRecorderService/IngestStats"
    24  	AnalyticsRecorderService_IngestEvents_FullMethodName = "/livekit.AnalyticsRecorderService/IngestEvents"
    25  )
    26  
    27  // AnalyticsRecorderServiceClient is the client API for AnalyticsRecorderService service.
    28  //
    29  // 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.
    30  type AnalyticsRecorderServiceClient interface {
    31  	IngestStats(ctx context.Context, opts ...grpc.CallOption) (AnalyticsRecorderService_IngestStatsClient, error)
    32  	IngestEvents(ctx context.Context, opts ...grpc.CallOption) (AnalyticsRecorderService_IngestEventsClient, error)
    33  }
    34  
    35  type analyticsRecorderServiceClient struct {
    36  	cc grpc.ClientConnInterface
    37  }
    38  
    39  func NewAnalyticsRecorderServiceClient(cc grpc.ClientConnInterface) AnalyticsRecorderServiceClient {
    40  	return &analyticsRecorderServiceClient{cc}
    41  }
    42  
    43  func (c *analyticsRecorderServiceClient) IngestStats(ctx context.Context, opts ...grpc.CallOption) (AnalyticsRecorderService_IngestStatsClient, error) {
    44  	stream, err := c.cc.NewStream(ctx, &AnalyticsRecorderService_ServiceDesc.Streams[0], AnalyticsRecorderService_IngestStats_FullMethodName, opts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	x := &analyticsRecorderServiceIngestStatsClient{stream}
    49  	return x, nil
    50  }
    51  
    52  type AnalyticsRecorderService_IngestStatsClient interface {
    53  	Send(*AnalyticsStats) error
    54  	CloseAndRecv() (*emptypb.Empty, error)
    55  	grpc.ClientStream
    56  }
    57  
    58  type analyticsRecorderServiceIngestStatsClient struct {
    59  	grpc.ClientStream
    60  }
    61  
    62  func (x *analyticsRecorderServiceIngestStatsClient) Send(m *AnalyticsStats) error {
    63  	return x.ClientStream.SendMsg(m)
    64  }
    65  
    66  func (x *analyticsRecorderServiceIngestStatsClient) CloseAndRecv() (*emptypb.Empty, error) {
    67  	if err := x.ClientStream.CloseSend(); err != nil {
    68  		return nil, err
    69  	}
    70  	m := new(emptypb.Empty)
    71  	if err := x.ClientStream.RecvMsg(m); err != nil {
    72  		return nil, err
    73  	}
    74  	return m, nil
    75  }
    76  
    77  func (c *analyticsRecorderServiceClient) IngestEvents(ctx context.Context, opts ...grpc.CallOption) (AnalyticsRecorderService_IngestEventsClient, error) {
    78  	stream, err := c.cc.NewStream(ctx, &AnalyticsRecorderService_ServiceDesc.Streams[1], AnalyticsRecorderService_IngestEvents_FullMethodName, opts...)
    79  	if err != nil {
    80  		return nil, err
    81  	}
    82  	x := &analyticsRecorderServiceIngestEventsClient{stream}
    83  	return x, nil
    84  }
    85  
    86  type AnalyticsRecorderService_IngestEventsClient interface {
    87  	Send(*AnalyticsEvents) error
    88  	CloseAndRecv() (*emptypb.Empty, error)
    89  	grpc.ClientStream
    90  }
    91  
    92  type analyticsRecorderServiceIngestEventsClient struct {
    93  	grpc.ClientStream
    94  }
    95  
    96  func (x *analyticsRecorderServiceIngestEventsClient) Send(m *AnalyticsEvents) error {
    97  	return x.ClientStream.SendMsg(m)
    98  }
    99  
   100  func (x *analyticsRecorderServiceIngestEventsClient) CloseAndRecv() (*emptypb.Empty, error) {
   101  	if err := x.ClientStream.CloseSend(); err != nil {
   102  		return nil, err
   103  	}
   104  	m := new(emptypb.Empty)
   105  	if err := x.ClientStream.RecvMsg(m); err != nil {
   106  		return nil, err
   107  	}
   108  	return m, nil
   109  }
   110  
   111  // AnalyticsRecorderServiceServer is the server API for AnalyticsRecorderService service.
   112  // All implementations must embed UnimplementedAnalyticsRecorderServiceServer
   113  // for forward compatibility
   114  type AnalyticsRecorderServiceServer interface {
   115  	IngestStats(AnalyticsRecorderService_IngestStatsServer) error
   116  	IngestEvents(AnalyticsRecorderService_IngestEventsServer) error
   117  	mustEmbedUnimplementedAnalyticsRecorderServiceServer()
   118  }
   119  
   120  // UnimplementedAnalyticsRecorderServiceServer must be embedded to have forward compatible implementations.
   121  type UnimplementedAnalyticsRecorderServiceServer struct {
   122  }
   123  
   124  func (UnimplementedAnalyticsRecorderServiceServer) IngestStats(AnalyticsRecorderService_IngestStatsServer) error {
   125  	return status.Errorf(codes.Unimplemented, "method IngestStats not implemented")
   126  }
   127  func (UnimplementedAnalyticsRecorderServiceServer) IngestEvents(AnalyticsRecorderService_IngestEventsServer) error {
   128  	return status.Errorf(codes.Unimplemented, "method IngestEvents not implemented")
   129  }
   130  func (UnimplementedAnalyticsRecorderServiceServer) mustEmbedUnimplementedAnalyticsRecorderServiceServer() {
   131  }
   132  
   133  // UnsafeAnalyticsRecorderServiceServer may be embedded to opt out of forward compatibility for this service.
   134  // Use of this interface is not recommended, as added methods to AnalyticsRecorderServiceServer will
   135  // result in compilation errors.
   136  type UnsafeAnalyticsRecorderServiceServer interface {
   137  	mustEmbedUnimplementedAnalyticsRecorderServiceServer()
   138  }
   139  
   140  func RegisterAnalyticsRecorderServiceServer(s grpc.ServiceRegistrar, srv AnalyticsRecorderServiceServer) {
   141  	s.RegisterService(&AnalyticsRecorderService_ServiceDesc, srv)
   142  }
   143  
   144  func _AnalyticsRecorderService_IngestStats_Handler(srv interface{}, stream grpc.ServerStream) error {
   145  	return srv.(AnalyticsRecorderServiceServer).IngestStats(&analyticsRecorderServiceIngestStatsServer{stream})
   146  }
   147  
   148  type AnalyticsRecorderService_IngestStatsServer interface {
   149  	SendAndClose(*emptypb.Empty) error
   150  	Recv() (*AnalyticsStats, error)
   151  	grpc.ServerStream
   152  }
   153  
   154  type analyticsRecorderServiceIngestStatsServer struct {
   155  	grpc.ServerStream
   156  }
   157  
   158  func (x *analyticsRecorderServiceIngestStatsServer) SendAndClose(m *emptypb.Empty) error {
   159  	return x.ServerStream.SendMsg(m)
   160  }
   161  
   162  func (x *analyticsRecorderServiceIngestStatsServer) Recv() (*AnalyticsStats, error) {
   163  	m := new(AnalyticsStats)
   164  	if err := x.ServerStream.RecvMsg(m); err != nil {
   165  		return nil, err
   166  	}
   167  	return m, nil
   168  }
   169  
   170  func _AnalyticsRecorderService_IngestEvents_Handler(srv interface{}, stream grpc.ServerStream) error {
   171  	return srv.(AnalyticsRecorderServiceServer).IngestEvents(&analyticsRecorderServiceIngestEventsServer{stream})
   172  }
   173  
   174  type AnalyticsRecorderService_IngestEventsServer interface {
   175  	SendAndClose(*emptypb.Empty) error
   176  	Recv() (*AnalyticsEvents, error)
   177  	grpc.ServerStream
   178  }
   179  
   180  type analyticsRecorderServiceIngestEventsServer struct {
   181  	grpc.ServerStream
   182  }
   183  
   184  func (x *analyticsRecorderServiceIngestEventsServer) SendAndClose(m *emptypb.Empty) error {
   185  	return x.ServerStream.SendMsg(m)
   186  }
   187  
   188  func (x *analyticsRecorderServiceIngestEventsServer) Recv() (*AnalyticsEvents, error) {
   189  	m := new(AnalyticsEvents)
   190  	if err := x.ServerStream.RecvMsg(m); err != nil {
   191  		return nil, err
   192  	}
   193  	return m, nil
   194  }
   195  
   196  // AnalyticsRecorderService_ServiceDesc is the grpc.ServiceDesc for AnalyticsRecorderService service.
   197  // It's only intended for direct use with grpc.RegisterService,
   198  // and not to be introspected or modified (even as a copy)
   199  var AnalyticsRecorderService_ServiceDesc = grpc.ServiceDesc{
   200  	ServiceName: "livekit.AnalyticsRecorderService",
   201  	HandlerType: (*AnalyticsRecorderServiceServer)(nil),
   202  	Methods:     []grpc.MethodDesc{},
   203  	Streams: []grpc.StreamDesc{
   204  		{
   205  			StreamName:    "IngestStats",
   206  			Handler:       _AnalyticsRecorderService_IngestStats_Handler,
   207  			ClientStreams: true,
   208  		},
   209  		{
   210  			StreamName:    "IngestEvents",
   211  			Handler:       _AnalyticsRecorderService_IngestEvents_Handler,
   212  			ClientStreams: true,
   213  		},
   214  	},
   215  	Metadata: "livekit_analytics.proto",
   216  }