// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.14.0
// source: signaling.proto

package localserver

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

// SignalingServiceClient is the client API for SignalingService 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 SignalingServiceClient interface {
	Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
	Link(ctx context.Context, opts ...grpc.CallOption) (SignalingService_LinkClient, error)
}

type signalingServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewSignalingServiceClient(cc grpc.ClientConnInterface) SignalingServiceClient {
	return &signalingServiceClient{cc}
}

func (c *signalingServiceClient) Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
	out := new(NotifyResponse)
	err := c.cc.Invoke(ctx, "/signaling.SignalingService/Notify", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *signalingServiceClient) Link(ctx context.Context, opts ...grpc.CallOption) (SignalingService_LinkClient, error) {
	stream, err := c.cc.NewStream(ctx, &SignalingService_ServiceDesc.Streams[0], "/signaling.SignalingService/Link", opts...)
	if err != nil {
		return nil, err
	}
	x := &signalingServiceLinkClient{stream}
	return x, nil
}

type SignalingService_LinkClient interface {
	Send(*SignalingMessage) error
	Recv() (*SignalingMessage, error)
	grpc.ClientStream
}

type signalingServiceLinkClient struct {
	grpc.ClientStream
}

func (x *signalingServiceLinkClient) Send(m *SignalingMessage) error {
	return x.ClientStream.SendMsg(m)
}

func (x *signalingServiceLinkClient) Recv() (*SignalingMessage, error) {
	m := new(SignalingMessage)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// SignalingServiceServer is the server API for SignalingService service.
// All implementations must embed UnimplementedSignalingServiceServer
// for forward compatibility
type SignalingServiceServer interface {
	Notify(context.Context, *NotifyRequest) (*NotifyResponse, error)
	Link(SignalingService_LinkServer) error
	mustEmbedUnimplementedSignalingServiceServer()
}

// UnimplementedSignalingServiceServer must be embedded to have forward compatible implementations.
type UnimplementedSignalingServiceServer struct {
}

func (UnimplementedSignalingServiceServer) Notify(context.Context, *NotifyRequest) (*NotifyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Notify not implemented")
}
func (UnimplementedSignalingServiceServer) Link(SignalingService_LinkServer) error {
	return status.Errorf(codes.Unimplemented, "method Link not implemented")
}
func (UnimplementedSignalingServiceServer) mustEmbedUnimplementedSignalingServiceServer() {}

// UnsafeSignalingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SignalingServiceServer will
// result in compilation errors.
type UnsafeSignalingServiceServer interface {
	mustEmbedUnimplementedSignalingServiceServer()
}

func RegisterSignalingServiceServer(s grpc.ServiceRegistrar, srv SignalingServiceServer) {
	s.RegisterService(&SignalingService_ServiceDesc, srv)
}

func _SignalingService_Notify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(NotifyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SignalingServiceServer).Notify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/signaling.SignalingService/Notify",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SignalingServiceServer).Notify(ctx, req.(*NotifyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SignalingService_Link_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(SignalingServiceServer).Link(&signalingServiceLinkServer{stream})
}

type SignalingService_LinkServer interface {
	Send(*SignalingMessage) error
	Recv() (*SignalingMessage, error)
	grpc.ServerStream
}

type signalingServiceLinkServer struct {
	grpc.ServerStream
}

func (x *signalingServiceLinkServer) Send(m *SignalingMessage) error {
	return x.ServerStream.SendMsg(m)
}

func (x *signalingServiceLinkServer) Recv() (*SignalingMessage, error) {
	m := new(SignalingMessage)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// SignalingService_ServiceDesc is the grpc.ServiceDesc for SignalingService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SignalingService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "signaling.SignalingService",
	HandlerType: (*SignalingServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Notify",
			Handler:    _SignalingService_Notify_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Link",
			Handler:       _SignalingService_Link_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "signaling.proto",
}
