// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package proto

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.
const _ = grpc.SupportPackageIsVersion7

// CrobatClient is the client API for Crobat 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 CrobatClient interface {
	GetSubdomains(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Crobat_GetSubdomainsClient, error)
	GetTLDs(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Crobat_GetTLDsClient, error)
	ReverseDNS(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Crobat_ReverseDNSClient, error)
	ReverseDNSRange(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Crobat_ReverseDNSRangeClient, error)
}

type crobatClient struct {
	cc grpc.ClientConnInterface
}

func NewCrobatClient(cc grpc.ClientConnInterface) CrobatClient {
	return &crobatClient{cc}
}

func (c *crobatClient) GetSubdomains(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Crobat_GetSubdomainsClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Crobat_serviceDesc.Streams[0], "/proto.Crobat/GetSubdomains", opts...)
	if err != nil {
		return nil, err
	}
	x := &crobatGetSubdomainsClient{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 Crobat_GetSubdomainsClient interface {
	Recv() (*Domain, error)
	grpc.ClientStream
}

type crobatGetSubdomainsClient struct {
	grpc.ClientStream
}

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

func (c *crobatClient) GetTLDs(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Crobat_GetTLDsClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Crobat_serviceDesc.Streams[1], "/proto.Crobat/GetTLDs", opts...)
	if err != nil {
		return nil, err
	}
	x := &crobatGetTLDsClient{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 Crobat_GetTLDsClient interface {
	Recv() (*Domain, error)
	grpc.ClientStream
}

type crobatGetTLDsClient struct {
	grpc.ClientStream
}

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

func (c *crobatClient) ReverseDNS(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Crobat_ReverseDNSClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Crobat_serviceDesc.Streams[2], "/proto.Crobat/ReverseDNS", opts...)
	if err != nil {
		return nil, err
	}
	x := &crobatReverseDNSClient{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 Crobat_ReverseDNSClient interface {
	Recv() (*Domain, error)
	grpc.ClientStream
}

type crobatReverseDNSClient struct {
	grpc.ClientStream
}

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

func (c *crobatClient) ReverseDNSRange(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (Crobat_ReverseDNSRangeClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Crobat_serviceDesc.Streams[3], "/proto.Crobat/ReverseDNSRange", opts...)
	if err != nil {
		return nil, err
	}
	x := &crobatReverseDNSRangeClient{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 Crobat_ReverseDNSRangeClient interface {
	Recv() (*Domain, error)
	grpc.ClientStream
}

type crobatReverseDNSRangeClient struct {
	grpc.ClientStream
}

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

// CrobatServer is the server API for Crobat service.
// All implementations must embed UnimplementedCrobatServer
// for forward compatibility
type CrobatServer interface {
	GetSubdomains(*QueryRequest, Crobat_GetSubdomainsServer) error
	GetTLDs(*QueryRequest, Crobat_GetTLDsServer) error
	ReverseDNS(*QueryRequest, Crobat_ReverseDNSServer) error
	ReverseDNSRange(*QueryRequest, Crobat_ReverseDNSRangeServer) error
	mustEmbedUnimplementedCrobatServer()
}

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

func (UnimplementedCrobatServer) GetSubdomains(*QueryRequest, Crobat_GetSubdomainsServer) error {
	return status.Errorf(codes.Unimplemented, "method GetSubdomains not implemented")
}
func (UnimplementedCrobatServer) GetTLDs(*QueryRequest, Crobat_GetTLDsServer) error {
	return status.Errorf(codes.Unimplemented, "method GetTLDs not implemented")
}
func (UnimplementedCrobatServer) ReverseDNS(*QueryRequest, Crobat_ReverseDNSServer) error {
	return status.Errorf(codes.Unimplemented, "method ReverseDNS not implemented")
}
func (UnimplementedCrobatServer) ReverseDNSRange(*QueryRequest, Crobat_ReverseDNSRangeServer) error {
	return status.Errorf(codes.Unimplemented, "method ReverseDNSRange not implemented")
}
func (UnimplementedCrobatServer) mustEmbedUnimplementedCrobatServer() {}

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

func RegisterCrobatServer(s grpc.ServiceRegistrar, srv CrobatServer) {
	s.RegisterService(&_Crobat_serviceDesc, srv)
}

func _Crobat_GetSubdomains_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(QueryRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(CrobatServer).GetSubdomains(m, &crobatGetSubdomainsServer{stream})
}

type Crobat_GetSubdomainsServer interface {
	Send(*Domain) error
	grpc.ServerStream
}

type crobatGetSubdomainsServer struct {
	grpc.ServerStream
}

func (x *crobatGetSubdomainsServer) Send(m *Domain) error {
	return x.ServerStream.SendMsg(m)
}

func _Crobat_GetTLDs_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(QueryRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(CrobatServer).GetTLDs(m, &crobatGetTLDsServer{stream})
}

type Crobat_GetTLDsServer interface {
	Send(*Domain) error
	grpc.ServerStream
}

type crobatGetTLDsServer struct {
	grpc.ServerStream
}

func (x *crobatGetTLDsServer) Send(m *Domain) error {
	return x.ServerStream.SendMsg(m)
}

func _Crobat_ReverseDNS_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(QueryRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(CrobatServer).ReverseDNS(m, &crobatReverseDNSServer{stream})
}

type Crobat_ReverseDNSServer interface {
	Send(*Domain) error
	grpc.ServerStream
}

type crobatReverseDNSServer struct {
	grpc.ServerStream
}

func (x *crobatReverseDNSServer) Send(m *Domain) error {
	return x.ServerStream.SendMsg(m)
}

func _Crobat_ReverseDNSRange_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(QueryRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(CrobatServer).ReverseDNSRange(m, &crobatReverseDNSRangeServer{stream})
}

type Crobat_ReverseDNSRangeServer interface {
	Send(*Domain) error
	grpc.ServerStream
}

type crobatReverseDNSRangeServer struct {
	grpc.ServerStream
}

func (x *crobatReverseDNSRangeServer) Send(m *Domain) error {
	return x.ServerStream.SendMsg(m)
}

var _Crobat_serviceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Crobat",
	HandlerType: (*CrobatServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetSubdomains",
			Handler:       _Crobat_GetSubdomains_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "GetTLDs",
			Handler:       _Crobat_GetTLDs_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ReverseDNS",
			Handler:       _Crobat_ReverseDNS_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ReverseDNSRange",
			Handler:       _Crobat_ReverseDNSRange_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "crobat.proto",
}
