Files
portmaster/plugin/shared/proto/notification_grpc.pb.go
2023-09-22 12:07:28 +02:00

133 lines
4.8 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.2
// source: notification.proto
package proto
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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// NotificationServiceClient is the client API for NotificationService 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 NotificationServiceClient interface {
CreateNotification(ctx context.Context, in *CreateNotificationRequest, opts ...grpc.CallOption) (NotificationService_CreateNotificationClient, error)
}
type notificationServiceClient struct {
cc grpc.ClientConnInterface
}
func NewNotificationServiceClient(cc grpc.ClientConnInterface) NotificationServiceClient {
return &notificationServiceClient{cc}
}
func (c *notificationServiceClient) CreateNotification(ctx context.Context, in *CreateNotificationRequest, opts ...grpc.CallOption) (NotificationService_CreateNotificationClient, error) {
stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[0], "/safing.portmaster.plugin.proto.NotificationService/CreateNotification", opts...)
if err != nil {
return nil, err
}
x := &notificationServiceCreateNotificationClient{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
}
type NotificationService_CreateNotificationClient interface {
Recv() (*CreateNotificationResponse, error)
grpc.ClientStream
}
type notificationServiceCreateNotificationClient struct {
grpc.ClientStream
}
func (x *notificationServiceCreateNotificationClient) Recv() (*CreateNotificationResponse, error) {
m := new(CreateNotificationResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// NotificationServiceServer is the server API for NotificationService service.
// All implementations must embed UnimplementedNotificationServiceServer
// for forward compatibility
type NotificationServiceServer interface {
CreateNotification(*CreateNotificationRequest, NotificationService_CreateNotificationServer) error
mustEmbedUnimplementedNotificationServiceServer()
}
// UnimplementedNotificationServiceServer must be embedded to have forward compatible implementations.
type UnimplementedNotificationServiceServer struct {
}
func (UnimplementedNotificationServiceServer) CreateNotification(*CreateNotificationRequest, NotificationService_CreateNotificationServer) error {
return status.Errorf(codes.Unimplemented, "method CreateNotification not implemented")
}
func (UnimplementedNotificationServiceServer) mustEmbedUnimplementedNotificationServiceServer() {}
// UnsafeNotificationServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NotificationServiceServer will
// result in compilation errors.
type UnsafeNotificationServiceServer interface {
mustEmbedUnimplementedNotificationServiceServer()
}
func RegisterNotificationServiceServer(s grpc.ServiceRegistrar, srv NotificationServiceServer) {
s.RegisterService(&NotificationService_ServiceDesc, srv)
}
func _NotificationService_CreateNotification_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(CreateNotificationRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(NotificationServiceServer).CreateNotification(m, &notificationServiceCreateNotificationServer{stream})
}
type NotificationService_CreateNotificationServer interface {
Send(*CreateNotificationResponse) error
grpc.ServerStream
}
type notificationServiceCreateNotificationServer struct {
grpc.ServerStream
}
func (x *notificationServiceCreateNotificationServer) Send(m *CreateNotificationResponse) error {
return x.ServerStream.SendMsg(m)
}
// NotificationService_ServiceDesc is the grpc.ServiceDesc for NotificationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NotificationService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "safing.portmaster.plugin.proto.NotificationService",
HandlerType: (*NotificationServiceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "CreateNotification",
Handler: _NotificationService_CreateNotification_Handler,
ServerStreams: true,
},
},
Metadata: "notification.proto",
}