github.com/livekit/protocol@v1.39.3/rpc/analytics_grpc.pb.go (about)

     1  // Copyright 2023 LiveKit, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.5.1
    18  // - protoc             v4.23.4
    19  // source: rpc/analytics.proto
    20  
    21  package rpc
    22  
    23  import (
    24  	context "context"
    25  	livekit "github.com/livekit/protocol/livekit"
    26  	grpc "google.golang.org/grpc"
    27  	codes "google.golang.org/grpc/codes"
    28  	status "google.golang.org/grpc/status"
    29  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    30  )
    31  
    32  // This is a compile-time assertion to ensure that this generated file
    33  // is compatible with the grpc package it is being compiled against.
    34  // Requires gRPC-Go v1.64.0 or later.
    35  const _ = grpc.SupportPackageIsVersion9
    36  
    37  const (
    38  	AnalyticsRecorderService_IngestStats_FullMethodName          = "/livekit.AnalyticsRecorderService/IngestStats"
    39  	AnalyticsRecorderService_IngestEvents_FullMethodName         = "/livekit.AnalyticsRecorderService/IngestEvents"
    40  	AnalyticsRecorderService_IngestNodeRoomStates_FullMethodName = "/livekit.AnalyticsRecorderService/IngestNodeRoomStates"
    41  )
    42  
    43  // AnalyticsRecorderServiceClient is the client API for AnalyticsRecorderService service.
    44  //
    45  // 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.
    46  type AnalyticsRecorderServiceClient interface {
    47  	IngestStats(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[livekit.AnalyticsStats, emptypb.Empty], error)
    48  	IngestEvents(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[livekit.AnalyticsEvents, emptypb.Empty], error)
    49  	IngestNodeRoomStates(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[livekit.AnalyticsNodeRooms, emptypb.Empty], error)
    50  }
    51  
    52  type analyticsRecorderServiceClient struct {
    53  	cc grpc.ClientConnInterface
    54  }
    55  
    56  func NewAnalyticsRecorderServiceClient(cc grpc.ClientConnInterface) AnalyticsRecorderServiceClient {
    57  	return &analyticsRecorderServiceClient{cc}
    58  }
    59  
    60  func (c *analyticsRecorderServiceClient) IngestStats(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[livekit.AnalyticsStats, emptypb.Empty], error) {
    61  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
    62  	stream, err := c.cc.NewStream(ctx, &AnalyticsRecorderService_ServiceDesc.Streams[0], AnalyticsRecorderService_IngestStats_FullMethodName, cOpts...)
    63  	if err != nil {
    64  		return nil, err
    65  	}
    66  	x := &grpc.GenericClientStream[livekit.AnalyticsStats, emptypb.Empty]{ClientStream: stream}
    67  	return x, nil
    68  }
    69  
    70  // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
    71  type AnalyticsRecorderService_IngestStatsClient = grpc.ClientStreamingClient[livekit.AnalyticsStats, emptypb.Empty]
    72  
    73  func (c *analyticsRecorderServiceClient) IngestEvents(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[livekit.AnalyticsEvents, emptypb.Empty], error) {
    74  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
    75  	stream, err := c.cc.NewStream(ctx, &AnalyticsRecorderService_ServiceDesc.Streams[1], AnalyticsRecorderService_IngestEvents_FullMethodName, cOpts...)
    76  	if err != nil {
    77  		return nil, err
    78  	}
    79  	x := &grpc.GenericClientStream[livekit.AnalyticsEvents, emptypb.Empty]{ClientStream: stream}
    80  	return x, nil
    81  }
    82  
    83  // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
    84  type AnalyticsRecorderService_IngestEventsClient = grpc.ClientStreamingClient[livekit.AnalyticsEvents, emptypb.Empty]
    85  
    86  func (c *analyticsRecorderServiceClient) IngestNodeRoomStates(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[livekit.AnalyticsNodeRooms, emptypb.Empty], error) {
    87  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
    88  	stream, err := c.cc.NewStream(ctx, &AnalyticsRecorderService_ServiceDesc.Streams[2], AnalyticsRecorderService_IngestNodeRoomStates_FullMethodName, cOpts...)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	x := &grpc.GenericClientStream[livekit.AnalyticsNodeRooms, emptypb.Empty]{ClientStream: stream}
    93  	return x, nil
    94  }
    95  
    96  // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
    97  type AnalyticsRecorderService_IngestNodeRoomStatesClient = grpc.ClientStreamingClient[livekit.AnalyticsNodeRooms, emptypb.Empty]
    98  
    99  // AnalyticsRecorderServiceServer is the server API for AnalyticsRecorderService service.
   100  // All implementations must embed UnimplementedAnalyticsRecorderServiceServer
   101  // for forward compatibility.
   102  type AnalyticsRecorderServiceServer interface {
   103  	IngestStats(grpc.ClientStreamingServer[livekit.AnalyticsStats, emptypb.Empty]) error
   104  	IngestEvents(grpc.ClientStreamingServer[livekit.AnalyticsEvents, emptypb.Empty]) error
   105  	IngestNodeRoomStates(grpc.ClientStreamingServer[livekit.AnalyticsNodeRooms, emptypb.Empty]) error
   106  	mustEmbedUnimplementedAnalyticsRecorderServiceServer()
   107  }
   108  
   109  // UnimplementedAnalyticsRecorderServiceServer must be embedded to have
   110  // forward compatible implementations.
   111  //
   112  // NOTE: this should be embedded by value instead of pointer to avoid a nil
   113  // pointer dereference when methods are called.
   114  type UnimplementedAnalyticsRecorderServiceServer struct{}
   115  
   116  func (UnimplementedAnalyticsRecorderServiceServer) IngestStats(grpc.ClientStreamingServer[livekit.AnalyticsStats, emptypb.Empty]) error {
   117  	return status.Errorf(codes.Unimplemented, "method IngestStats not implemented")
   118  }
   119  func (UnimplementedAnalyticsRecorderServiceServer) IngestEvents(grpc.ClientStreamingServer[livekit.AnalyticsEvents, emptypb.Empty]) error {
   120  	return status.Errorf(codes.Unimplemented, "method IngestEvents not implemented")
   121  }
   122  func (UnimplementedAnalyticsRecorderServiceServer) IngestNodeRoomStates(grpc.ClientStreamingServer[livekit.AnalyticsNodeRooms, emptypb.Empty]) error {
   123  	return status.Errorf(codes.Unimplemented, "method IngestNodeRoomStates not implemented")
   124  }
   125  func (UnimplementedAnalyticsRecorderServiceServer) mustEmbedUnimplementedAnalyticsRecorderServiceServer() {
   126  }
   127  func (UnimplementedAnalyticsRecorderServiceServer) testEmbeddedByValue() {}
   128  
   129  // UnsafeAnalyticsRecorderServiceServer may be embedded to opt out of forward compatibility for this service.
   130  // Use of this interface is not recommended, as added methods to AnalyticsRecorderServiceServer will
   131  // result in compilation errors.
   132  type UnsafeAnalyticsRecorderServiceServer interface {
   133  	mustEmbedUnimplementedAnalyticsRecorderServiceServer()
   134  }
   135  
   136  func RegisterAnalyticsRecorderServiceServer(s grpc.ServiceRegistrar, srv AnalyticsRecorderServiceServer) {
   137  	// If the following call pancis, it indicates UnimplementedAnalyticsRecorderServiceServer was
   138  	// embedded by pointer and is nil.  This will cause panics if an
   139  	// unimplemented method is ever invoked, so we test this at initialization
   140  	// time to prevent it from happening at runtime later due to I/O.
   141  	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
   142  		t.testEmbeddedByValue()
   143  	}
   144  	s.RegisterService(&AnalyticsRecorderService_ServiceDesc, srv)
   145  }
   146  
   147  func _AnalyticsRecorderService_IngestStats_Handler(srv interface{}, stream grpc.ServerStream) error {
   148  	return srv.(AnalyticsRecorderServiceServer).IngestStats(&grpc.GenericServerStream[livekit.AnalyticsStats, emptypb.Empty]{ServerStream: stream})
   149  }
   150  
   151  // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
   152  type AnalyticsRecorderService_IngestStatsServer = grpc.ClientStreamingServer[livekit.AnalyticsStats, emptypb.Empty]
   153  
   154  func _AnalyticsRecorderService_IngestEvents_Handler(srv interface{}, stream grpc.ServerStream) error {
   155  	return srv.(AnalyticsRecorderServiceServer).IngestEvents(&grpc.GenericServerStream[livekit.AnalyticsEvents, emptypb.Empty]{ServerStream: stream})
   156  }
   157  
   158  // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
   159  type AnalyticsRecorderService_IngestEventsServer = grpc.ClientStreamingServer[livekit.AnalyticsEvents, emptypb.Empty]
   160  
   161  func _AnalyticsRecorderService_IngestNodeRoomStates_Handler(srv interface{}, stream grpc.ServerStream) error {
   162  	return srv.(AnalyticsRecorderServiceServer).IngestNodeRoomStates(&grpc.GenericServerStream[livekit.AnalyticsNodeRooms, emptypb.Empty]{ServerStream: stream})
   163  }
   164  
   165  // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
   166  type AnalyticsRecorderService_IngestNodeRoomStatesServer = grpc.ClientStreamingServer[livekit.AnalyticsNodeRooms, emptypb.Empty]
   167  
   168  // AnalyticsRecorderService_ServiceDesc is the grpc.ServiceDesc for AnalyticsRecorderService service.
   169  // It's only intended for direct use with grpc.RegisterService,
   170  // and not to be introspected or modified (even as a copy)
   171  var AnalyticsRecorderService_ServiceDesc = grpc.ServiceDesc{
   172  	ServiceName: "livekit.AnalyticsRecorderService",
   173  	HandlerType: (*AnalyticsRecorderServiceServer)(nil),
   174  	Methods:     []grpc.MethodDesc{},
   175  	Streams: []grpc.StreamDesc{
   176  		{
   177  			StreamName:    "IngestStats",
   178  			Handler:       _AnalyticsRecorderService_IngestStats_Handler,
   179  			ClientStreams: true,
   180  		},
   181  		{
   182  			StreamName:    "IngestEvents",
   183  			Handler:       _AnalyticsRecorderService_IngestEvents_Handler,
   184  			ClientStreams: true,
   185  		},
   186  		{
   187  			StreamName:    "IngestNodeRoomStates",
   188  			Handler:       _AnalyticsRecorderService_IngestNodeRoomStates_Handler,
   189  			ClientStreams: true,
   190  		},
   191  	},
   192  	Metadata: "rpc/analytics.proto",
   193  }