// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             (unknown)
// source: machine/md.proto

package machine

import (
	context "context"

	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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 (
	MDService_Destroy_FullMethodName = "/machine.MDService/Destroy"
)

// MDServiceClient is the client API for MDService 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.
//
// MDService maintains MD (Multiple Device, software RAID) arrays.
//
//   - Destroy: stop the array and clear member superblocks.
type MDServiceClient interface {
	// Destroy stops the array and clears the superblock on every member.
	//
	// The array must not be in use (e.g. mounted or claimed by another
	// device) at the time of the call.
	Destroy(ctx context.Context, in *MDDestroyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type mDServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewMDServiceClient(cc grpc.ClientConnInterface) MDServiceClient {
	return &mDServiceClient{cc}
}

func (c *mDServiceClient) Destroy(ctx context.Context, in *MDDestroyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, MDService_Destroy_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// MDServiceServer is the server API for MDService service.
// All implementations must embed UnimplementedMDServiceServer
// for forward compatibility.
//
// MDService maintains MD (Multiple Device, software RAID) arrays.
//
//   - Destroy: stop the array and clear member superblocks.
type MDServiceServer interface {
	// Destroy stops the array and clears the superblock on every member.
	//
	// The array must not be in use (e.g. mounted or claimed by another
	// device) at the time of the call.
	Destroy(context.Context, *MDDestroyRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedMDServiceServer()
}

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

func (UnimplementedMDServiceServer) Destroy(context.Context, *MDDestroyRequest) (*emptypb.Empty, error) {
	return nil, status.Error(codes.Unimplemented, "method Destroy not implemented")
}
func (UnimplementedMDServiceServer) mustEmbedUnimplementedMDServiceServer() {}
func (UnimplementedMDServiceServer) testEmbeddedByValue()                   {}

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

func RegisterMDServiceServer(s grpc.ServiceRegistrar, srv MDServiceServer) {
	// If the following call panics, it indicates UnimplementedMDServiceServer 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(&MDService_ServiceDesc, srv)
}

func _MDService_Destroy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(MDDestroyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MDServiceServer).Destroy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: MDService_Destroy_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MDServiceServer).Destroy(ctx, req.(*MDDestroyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// MDService_ServiceDesc is the grpc.ServiceDesc for MDService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MDService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "machine.MDService",
	HandlerType: (*MDServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Destroy",
			Handler:    _MDService_Destroy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "machine/md.proto",
}
