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

package plugin_registry

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

const (
	PluginRegistryService_Get_FullMethodName      = "/gosdn.plugin_registry.PluginRegistryService/Get"
	PluginRegistryService_GetAll_FullMethodName   = "/gosdn.plugin_registry.PluginRegistryService/GetAll"
	PluginRegistryService_Download_FullMethodName = "/gosdn.plugin_registry.PluginRegistryService/Download"
	PluginRegistryService_Delete_FullMethodName   = "/gosdn.plugin_registry.PluginRegistryService/Delete"
)

// PluginRegistryServiceClient is the client API for PluginRegistryService 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 PluginRegistryServiceClient interface {
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	GetAll(ctx context.Context, in *GetAllRequest, opts ...grpc.CallOption) (*GetResponse, error)
	Download(ctx context.Context, in *GetDownloadRequest, opts ...grpc.CallOption) (PluginRegistryService_DownloadClient, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
}

type pluginRegistryServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewPluginRegistryServiceClient(cc grpc.ClientConnInterface) PluginRegistryServiceClient {
	return &pluginRegistryServiceClient{cc}
}

func (c *pluginRegistryServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
	out := new(GetResponse)
	err := c.cc.Invoke(ctx, PluginRegistryService_Get_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginRegistryServiceClient) GetAll(ctx context.Context, in *GetAllRequest, opts ...grpc.CallOption) (*GetResponse, error) {
	out := new(GetResponse)
	err := c.cc.Invoke(ctx, PluginRegistryService_GetAll_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginRegistryServiceClient) Download(ctx context.Context, in *GetDownloadRequest, opts ...grpc.CallOption) (PluginRegistryService_DownloadClient, error) {
	stream, err := c.cc.NewStream(ctx, &PluginRegistryService_ServiceDesc.Streams[0], PluginRegistryService_Download_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &pluginRegistryServiceDownloadClient{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 PluginRegistryService_DownloadClient interface {
	Recv() (*GetDownloadPayload, error)
	grpc.ClientStream
}

type pluginRegistryServiceDownloadClient struct {
	grpc.ClientStream
}

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

func (c *pluginRegistryServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
	out := new(DeleteResponse)
	err := c.cc.Invoke(ctx, PluginRegistryService_Delete_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PluginRegistryServiceServer is the server API for PluginRegistryService service.
// All implementations must embed UnimplementedPluginRegistryServiceServer
// for forward compatibility
type PluginRegistryServiceServer interface {
	Get(context.Context, *GetRequest) (*GetResponse, error)
	GetAll(context.Context, *GetAllRequest) (*GetResponse, error)
	Download(*GetDownloadRequest, PluginRegistryService_DownloadServer) error
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	mustEmbedUnimplementedPluginRegistryServiceServer()
}

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

func (UnimplementedPluginRegistryServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedPluginRegistryServiceServer) GetAll(context.Context, *GetAllRequest) (*GetResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented")
}
func (UnimplementedPluginRegistryServiceServer) Download(*GetDownloadRequest, PluginRegistryService_DownloadServer) error {
	return status.Errorf(codes.Unimplemented, "method Download not implemented")
}
func (UnimplementedPluginRegistryServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedPluginRegistryServiceServer) mustEmbedUnimplementedPluginRegistryServiceServer() {}

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

func RegisterPluginRegistryServiceServer(s grpc.ServiceRegistrar, srv PluginRegistryServiceServer) {
	s.RegisterService(&PluginRegistryService_ServiceDesc, srv)
}

func _PluginRegistryService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginRegistryServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PluginRegistryService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginRegistryServiceServer).Get(ctx, req.(*GetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PluginRegistryService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAllRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginRegistryServiceServer).GetAll(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PluginRegistryService_GetAll_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginRegistryServiceServer).GetAll(ctx, req.(*GetAllRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PluginRegistryService_Download_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetDownloadRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(PluginRegistryServiceServer).Download(m, &pluginRegistryServiceDownloadServer{stream})
}

type PluginRegistryService_DownloadServer interface {
	Send(*GetDownloadPayload) error
	grpc.ServerStream
}

type pluginRegistryServiceDownloadServer struct {
	grpc.ServerStream
}

func (x *pluginRegistryServiceDownloadServer) Send(m *GetDownloadPayload) error {
	return x.ServerStream.SendMsg(m)
}

func _PluginRegistryService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginRegistryServiceServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PluginRegistryService_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginRegistryServiceServer).Delete(ctx, req.(*DeleteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// PluginRegistryService_ServiceDesc is the grpc.ServiceDesc for PluginRegistryService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PluginRegistryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gosdn.plugin_registry.PluginRegistryService",
	HandlerType: (*PluginRegistryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _PluginRegistryService_Get_Handler,
		},
		{
			MethodName: "GetAll",
			Handler:    _PluginRegistryService_GetAll_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _PluginRegistryService_Delete_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Download",
			Handler:       _PluginRegistryService_Download_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "gosdn/plugin-registry/plugin-registry.proto",
}
