// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v4.25.1
// source: couchbase/search/v1/search.proto

package search_v1

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

// SearchServiceClient is the client API for SearchService 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 SearchServiceClient interface {
	SearchQuery(ctx context.Context, in *SearchQueryRequest, opts ...grpc.CallOption) (SearchService_SearchQueryClient, error)
}

type searchServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewSearchServiceClient(cc grpc.ClientConnInterface) SearchServiceClient {
	return &searchServiceClient{cc}
}

func (c *searchServiceClient) SearchQuery(ctx context.Context, in *SearchQueryRequest, opts ...grpc.CallOption) (SearchService_SearchQueryClient, error) {
	stream, err := c.cc.NewStream(ctx, &SearchService_ServiceDesc.Streams[0], "/couchbase.search.v1.SearchService/SearchQuery", opts...)
	if err != nil {
		return nil, err
	}
	x := &searchServiceSearchQueryClient{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 SearchService_SearchQueryClient interface {
	Recv() (*SearchQueryResponse, error)
	grpc.ClientStream
}

type searchServiceSearchQueryClient struct {
	grpc.ClientStream
}

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

// SearchServiceServer is the server API for SearchService service.
// All implementations must embed UnimplementedSearchServiceServer
// for forward compatibility
type SearchServiceServer interface {
	SearchQuery(*SearchQueryRequest, SearchService_SearchQueryServer) error
	mustEmbedUnimplementedSearchServiceServer()
}

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

func (UnimplementedSearchServiceServer) SearchQuery(*SearchQueryRequest, SearchService_SearchQueryServer) error {
	return status.Errorf(codes.Unimplemented, "method SearchQuery not implemented")
}
func (UnimplementedSearchServiceServer) mustEmbedUnimplementedSearchServiceServer() {}

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

func RegisterSearchServiceServer(s grpc.ServiceRegistrar, srv SearchServiceServer) {
	s.RegisterService(&SearchService_ServiceDesc, srv)
}

func _SearchService_SearchQuery_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(SearchQueryRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(SearchServiceServer).SearchQuery(m, &searchServiceSearchQueryServer{stream})
}

type SearchService_SearchQueryServer interface {
	Send(*SearchQueryResponse) error
	grpc.ServerStream
}

type searchServiceSearchQueryServer struct {
	grpc.ServerStream
}

func (x *searchServiceSearchQueryServer) Send(m *SearchQueryResponse) error {
	return x.ServerStream.SendMsg(m)
}

// SearchService_ServiceDesc is the grpc.ServiceDesc for SearchService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SearchService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "couchbase.search.v1.SearchService",
	HandlerType: (*SearchServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SearchQuery",
			Handler:       _SearchService_SearchQuery_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "couchbase/search/v1/search.proto",
}
