// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             (unknown)
// source: gosdn/plugin-internal/plugin-internal.proto

package plugin_internal

import (
	plugin_registry "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/plugin-registry"
	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

const (
	PluginInternalService_AvailablePlugins_FullMethodName = "/gosdn.plugin_internal.PluginInternalService/AvailablePlugins"
	PluginInternalService_GetPluginSchema_FullMethodName  = "/gosdn.plugin_internal.PluginInternalService/GetPluginSchema"
)

// PluginInternalServiceClient is the client API for PluginInternalService 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 PluginInternalServiceClient interface {
	AvailablePlugins(ctx context.Context, in *GetAvailablePluginsRequest, opts ...grpc.CallOption) (*plugin_registry.GetResponse, error)
	GetPluginSchema(ctx context.Context, in *GetPluginSchemaRequest, opts ...grpc.CallOption) (PluginInternalService_GetPluginSchemaClient, error)
}

type pluginInternalServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewPluginInternalServiceClient(cc grpc.ClientConnInterface) PluginInternalServiceClient {
	return &pluginInternalServiceClient{cc}
}

func (c *pluginInternalServiceClient) AvailablePlugins(ctx context.Context, in *GetAvailablePluginsRequest, opts ...grpc.CallOption) (*plugin_registry.GetResponse, error) {
	out := new(plugin_registry.GetResponse)
	err := c.cc.Invoke(ctx, PluginInternalService_AvailablePlugins_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginInternalServiceClient) GetPluginSchema(ctx context.Context, in *GetPluginSchemaRequest, opts ...grpc.CallOption) (PluginInternalService_GetPluginSchemaClient, error) {
	stream, err := c.cc.NewStream(ctx, &PluginInternalService_ServiceDesc.Streams[0], PluginInternalService_GetPluginSchema_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &pluginInternalServiceGetPluginSchemaClient{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 PluginInternalService_GetPluginSchemaClient interface {
	Recv() (*PluginSchemaPayload, error)
	grpc.ClientStream
}

type pluginInternalServiceGetPluginSchemaClient struct {
	grpc.ClientStream
}

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

// PluginInternalServiceServer is the server API for PluginInternalService service.
// All implementations must embed UnimplementedPluginInternalServiceServer
// for forward compatibility
type PluginInternalServiceServer interface {
	AvailablePlugins(context.Context, *GetAvailablePluginsRequest) (*plugin_registry.GetResponse, error)
	GetPluginSchema(*GetPluginSchemaRequest, PluginInternalService_GetPluginSchemaServer) error
	mustEmbedUnimplementedPluginInternalServiceServer()
}

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

func (UnimplementedPluginInternalServiceServer) AvailablePlugins(context.Context, *GetAvailablePluginsRequest) (*plugin_registry.GetResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AvailablePlugins not implemented")
}
func (UnimplementedPluginInternalServiceServer) GetPluginSchema(*GetPluginSchemaRequest, PluginInternalService_GetPluginSchemaServer) error {
	return status.Errorf(codes.Unimplemented, "method GetPluginSchema not implemented")
}
func (UnimplementedPluginInternalServiceServer) mustEmbedUnimplementedPluginInternalServiceServer() {}

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

func RegisterPluginInternalServiceServer(s grpc.ServiceRegistrar, srv PluginInternalServiceServer) {
	s.RegisterService(&PluginInternalService_ServiceDesc, srv)
}

func _PluginInternalService_AvailablePlugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAvailablePluginsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginInternalServiceServer).AvailablePlugins(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PluginInternalService_AvailablePlugins_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginInternalServiceServer).AvailablePlugins(ctx, req.(*GetAvailablePluginsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PluginInternalService_GetPluginSchema_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetPluginSchemaRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(PluginInternalServiceServer).GetPluginSchema(m, &pluginInternalServiceGetPluginSchemaServer{stream})
}

type PluginInternalService_GetPluginSchemaServer interface {
	Send(*PluginSchemaPayload) error
	grpc.ServerStream
}

type pluginInternalServiceGetPluginSchemaServer struct {
	grpc.ServerStream
}

func (x *pluginInternalServiceGetPluginSchemaServer) Send(m *PluginSchemaPayload) error {
	return x.ServerStream.SendMsg(m)
}

// PluginInternalService_ServiceDesc is the grpc.ServiceDesc for PluginInternalService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PluginInternalService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gosdn.plugin_internal.PluginInternalService",
	HandlerType: (*PluginInternalServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AvailablePlugins",
			Handler:    _PluginInternalService_AvailablePlugins_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetPluginSchema",
			Handler:       _PluginInternalService_GetPluginSchema_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "gosdn/plugin-internal/plugin-internal.proto",
}
