// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v6.31.1
// source: siderolink/wireguard.proto

package pb

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 (
	WireGuardOverGRPCService_CreateStream_FullMethodName = "/sidero.link.WireGuardOverGRPCService/CreateStream"
)

// WireGuardOverGRPCServiceClient is the client API for WireGuardOverGRPCService 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.
//
// WireGuardOverGRPCService provides a service for sending and receiving WireGuard packets over gRPC.
type WireGuardOverGRPCServiceClient interface {
	// CreateStream creates a new stream for sending and receiving WireGuard packets.
	// It should contain 'x-siderolink-ipv6-addr' metadata with the virtual IPv6 address of the peer, which
	// was provided by the server when the peer was added.
	CreateStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[PeerPacket, PeerPacket], error)
}

type wireGuardOverGRPCServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewWireGuardOverGRPCServiceClient(cc grpc.ClientConnInterface) WireGuardOverGRPCServiceClient {
	return &wireGuardOverGRPCServiceClient{cc}
}

func (c *wireGuardOverGRPCServiceClient) CreateStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[PeerPacket, PeerPacket], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &WireGuardOverGRPCService_ServiceDesc.Streams[0], WireGuardOverGRPCService_CreateStream_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[PeerPacket, PeerPacket]{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 WireGuardOverGRPCService_CreateStreamClient = grpc.BidiStreamingClient[PeerPacket, PeerPacket]

// WireGuardOverGRPCServiceServer is the server API for WireGuardOverGRPCService service.
// All implementations must embed UnimplementedWireGuardOverGRPCServiceServer
// for forward compatibility.
//
// WireGuardOverGRPCService provides a service for sending and receiving WireGuard packets over gRPC.
type WireGuardOverGRPCServiceServer interface {
	// CreateStream creates a new stream for sending and receiving WireGuard packets.
	// It should contain 'x-siderolink-ipv6-addr' metadata with the virtual IPv6 address of the peer, which
	// was provided by the server when the peer was added.
	CreateStream(grpc.BidiStreamingServer[PeerPacket, PeerPacket]) error
	mustEmbedUnimplementedWireGuardOverGRPCServiceServer()
}

// UnimplementedWireGuardOverGRPCServiceServer 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 UnimplementedWireGuardOverGRPCServiceServer struct{}

func (UnimplementedWireGuardOverGRPCServiceServer) CreateStream(grpc.BidiStreamingServer[PeerPacket, PeerPacket]) error {
	return status.Error(codes.Unimplemented, "method CreateStream not implemented")
}
func (UnimplementedWireGuardOverGRPCServiceServer) mustEmbedUnimplementedWireGuardOverGRPCServiceServer() {
}
func (UnimplementedWireGuardOverGRPCServiceServer) testEmbeddedByValue() {}

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

func RegisterWireGuardOverGRPCServiceServer(s grpc.ServiceRegistrar, srv WireGuardOverGRPCServiceServer) {
	// If the following call panics, it indicates UnimplementedWireGuardOverGRPCServiceServer 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(&WireGuardOverGRPCService_ServiceDesc, srv)
}

func _WireGuardOverGRPCService_CreateStream_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(WireGuardOverGRPCServiceServer).CreateStream(&grpc.GenericServerStream[PeerPacket, PeerPacket]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WireGuardOverGRPCService_CreateStreamServer = grpc.BidiStreamingServer[PeerPacket, PeerPacket]

// WireGuardOverGRPCService_ServiceDesc is the grpc.ServiceDesc for WireGuardOverGRPCService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WireGuardOverGRPCService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sidero.link.WireGuardOverGRPCService",
	HandlerType: (*WireGuardOverGRPCServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CreateStream",
			Handler:       _WireGuardOverGRPCService_CreateStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "siderolink/wireguard.proto",
}
