feat: add event and slug proto
This commit is contained in:
125
gen/events_grpc.pb.go
Normal file
125
gen/events_grpc.pb.go
Normal file
@@ -0,0 +1,125 @@
|
||||
// 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"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// 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 = "/events.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, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
|
||||
}
|
||||
|
||||
type eventServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient {
|
||||
return &eventServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *eventServiceClient) Subscribe(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], 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[emptypb.Empty, Event]{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 EventService_SubscribeClient = grpc.ServerStreamingClient[Event]
|
||||
|
||||
// EventServiceServer is the server API for EventService service.
|
||||
// All implementations must embed UnimplementedEventServiceServer
|
||||
// for forward compatibility.
|
||||
type EventServiceServer interface {
|
||||
Subscribe(*emptypb.Empty, grpc.ServerStreamingServer[Event]) 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(*emptypb.Empty, grpc.ServerStreamingServer[Event]) 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 {
|
||||
m := new(emptypb.Empty)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(EventServiceServer).Subscribe(m, &grpc.GenericServerStream[emptypb.Empty, Event]{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.ServerStreamingServer[Event]
|
||||
|
||||
// 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: "events.EventService",
|
||||
HandlerType: (*EventServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Subscribe",
|
||||
Handler: _EventService_Subscribe_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "events.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user