snapshot of https://github.com/centrifugal/centrifugo.git (master, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
124
internal/unigrpc/unistream/unistream_grpc.pb.go
Normal file
124
internal/unigrpc/unistream/unistream_grpc.pb.go
Normal file
@@ -0,0 +1,124 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v7.34.0
|
||||
// source: unistream.proto
|
||||
|
||||
package unistream
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
CentrifugoUniStream_Consume_FullMethodName = "/centrifugal.centrifugo.unistream.CentrifugoUniStream/Consume"
|
||||
)
|
||||
|
||||
// CentrifugoUniStreamClient is the client API for CentrifugoUniStream service.
|
||||
//
|
||||
// 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.
|
||||
type CentrifugoUniStreamClient interface {
|
||||
Consume(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Push], error)
|
||||
}
|
||||
|
||||
type centrifugoUniStreamClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewCentrifugoUniStreamClient(cc grpc.ClientConnInterface) CentrifugoUniStreamClient {
|
||||
return ¢rifugoUniStreamClient{cc}
|
||||
}
|
||||
|
||||
func (c *centrifugoUniStreamClient) Consume(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Push], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &CentrifugoUniStream_ServiceDesc.Streams[0], CentrifugoUniStream_Consume_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[ConnectRequest, Push]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CentrifugoUniStream_ConsumeClient = grpc.ServerStreamingClient[Push]
|
||||
|
||||
// CentrifugoUniStreamServer is the server API for CentrifugoUniStream service.
|
||||
// All implementations must embed UnimplementedCentrifugoUniStreamServer
|
||||
// for forward compatibility.
|
||||
type CentrifugoUniStreamServer interface {
|
||||
Consume(*ConnectRequest, grpc.ServerStreamingServer[Push]) error
|
||||
mustEmbedUnimplementedCentrifugoUniStreamServer()
|
||||
}
|
||||
|
||||
// UnimplementedCentrifugoUniStreamServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedCentrifugoUniStreamServer struct{}
|
||||
|
||||
func (UnimplementedCentrifugoUniStreamServer) Consume(*ConnectRequest, grpc.ServerStreamingServer[Push]) error {
|
||||
return status.Error(codes.Unimplemented, "method Consume not implemented")
|
||||
}
|
||||
func (UnimplementedCentrifugoUniStreamServer) mustEmbedUnimplementedCentrifugoUniStreamServer() {}
|
||||
func (UnimplementedCentrifugoUniStreamServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCentrifugoUniStreamServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CentrifugoUniStreamServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeCentrifugoUniStreamServer interface {
|
||||
mustEmbedUnimplementedCentrifugoUniStreamServer()
|
||||
}
|
||||
|
||||
func RegisterCentrifugoUniStreamServer(s grpc.ServiceRegistrar, srv CentrifugoUniStreamServer) {
|
||||
// If the following call panics, it indicates UnimplementedCentrifugoUniStreamServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&CentrifugoUniStream_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _CentrifugoUniStream_Consume_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(ConnectRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(CentrifugoUniStreamServer).Consume(m, &grpc.GenericServerStream[ConnectRequest, Push]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CentrifugoUniStream_ConsumeServer = grpc.ServerStreamingServer[Push]
|
||||
|
||||
// CentrifugoUniStream_ServiceDesc is the grpc.ServiceDesc for CentrifugoUniStream service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var CentrifugoUniStream_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "centrifugal.centrifugo.unistream.CentrifugoUniStream",
|
||||
HandlerType: (*CentrifugoUniStreamServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Consume",
|
||||
Handler: _CentrifugoUniStream_Consume_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "unistream.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user