116 lines
4.5 KiB
Go
116 lines
4.5 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.0
|
|
// - protoc v6.33.2
|
|
// source: events.proto
|
|
|
|
package gen
|
|
|
|
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 (
|
|
EventService_Subscribe_FullMethodName = "/slug.EventService/Subscribe"
|
|
)
|
|
|
|
// EventServiceClient is the client API for EventService 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 EventServiceClient interface {
|
|
Subscribe(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Client, Controller], error)
|
|
}
|
|
|
|
type eventServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient {
|
|
return &eventServiceClient{cc}
|
|
}
|
|
|
|
func (c *eventServiceClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Client, Controller], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &EventService_ServiceDesc.Streams[0], EventService_Subscribe_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[Client, Controller]{ClientStream: stream}
|
|
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 EventService_SubscribeClient = grpc.BidiStreamingClient[Client, Controller]
|
|
|
|
// EventServiceServer is the server API for EventService service.
|
|
// All implementations must embed UnimplementedEventServiceServer
|
|
// for forward compatibility.
|
|
type EventServiceServer interface {
|
|
Subscribe(grpc.BidiStreamingServer[Client, Controller]) error
|
|
mustEmbedUnimplementedEventServiceServer()
|
|
}
|
|
|
|
// UnimplementedEventServiceServer 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 UnimplementedEventServiceServer struct{}
|
|
|
|
func (UnimplementedEventServiceServer) Subscribe(grpc.BidiStreamingServer[Client, Controller]) error {
|
|
return status.Error(codes.Unimplemented, "method Subscribe not implemented")
|
|
}
|
|
func (UnimplementedEventServiceServer) mustEmbedUnimplementedEventServiceServer() {}
|
|
func (UnimplementedEventServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeEventServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to EventServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeEventServiceServer interface {
|
|
mustEmbedUnimplementedEventServiceServer()
|
|
}
|
|
|
|
func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedEventServiceServer 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(&EventService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _EventService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(EventServiceServer).Subscribe(&grpc.GenericServerStream[Client, Controller]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type EventService_SubscribeServer = grpc.BidiStreamingServer[Client, Controller]
|
|
|
|
// EventService_ServiceDesc is the grpc.ServiceDesc for EventService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var EventService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "slug.EventService",
|
|
HandlerType: (*EventServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Subscribe",
|
|
Handler: _EventService_Subscribe_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "events.proto",
|
|
}
|