// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.21.7
// source: internal/module/flux/rpc/rpc.proto

package rpc

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

// GitLabFluxClient is the client API for GitLabFlux 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 GitLabFluxClient interface {
	ReconcileProjects(ctx context.Context, in *ReconcileProjectsRequest, opts ...grpc.CallOption) (GitLabFlux_ReconcileProjectsClient, error)
}

type gitLabFluxClient struct {
	cc grpc.ClientConnInterface
}

func NewGitLabFluxClient(cc grpc.ClientConnInterface) GitLabFluxClient {
	return &gitLabFluxClient{cc}
}

func (c *gitLabFluxClient) ReconcileProjects(ctx context.Context, in *ReconcileProjectsRequest, opts ...grpc.CallOption) (GitLabFlux_ReconcileProjectsClient, error) {
	stream, err := c.cc.NewStream(ctx, &GitLabFlux_ServiceDesc.Streams[0], "/gitlab.agent.flux.rpc.GitLabFlux/ReconcileProjects", opts...)
	if err != nil {
		return nil, err
	}
	x := &gitLabFluxReconcileProjectsClient{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 GitLabFlux_ReconcileProjectsClient interface {
	Recv() (*ReconcileProjectsResponse, error)
	grpc.ClientStream
}

type gitLabFluxReconcileProjectsClient struct {
	grpc.ClientStream
}

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

// GitLabFluxServer is the server API for GitLabFlux service.
// All implementations must embed UnimplementedGitLabFluxServer
// for forward compatibility
type GitLabFluxServer interface {
	ReconcileProjects(*ReconcileProjectsRequest, GitLabFlux_ReconcileProjectsServer) error
	mustEmbedUnimplementedGitLabFluxServer()
}

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

func (UnimplementedGitLabFluxServer) ReconcileProjects(*ReconcileProjectsRequest, GitLabFlux_ReconcileProjectsServer) error {
	return status.Errorf(codes.Unimplemented, "method ReconcileProjects not implemented")
}
func (UnimplementedGitLabFluxServer) mustEmbedUnimplementedGitLabFluxServer() {}

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

func RegisterGitLabFluxServer(s grpc.ServiceRegistrar, srv GitLabFluxServer) {
	s.RegisterService(&GitLabFlux_ServiceDesc, srv)
}

func _GitLabFlux_ReconcileProjects_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(ReconcileProjectsRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GitLabFluxServer).ReconcileProjects(m, &gitLabFluxReconcileProjectsServer{stream})
}

type GitLabFlux_ReconcileProjectsServer interface {
	Send(*ReconcileProjectsResponse) error
	grpc.ServerStream
}

type gitLabFluxReconcileProjectsServer struct {
	grpc.ServerStream
}

func (x *gitLabFluxReconcileProjectsServer) Send(m *ReconcileProjectsResponse) error {
	return x.ServerStream.SendMsg(m)
}

// GitLabFlux_ServiceDesc is the grpc.ServiceDesc for GitLabFlux service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GitLabFlux_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitlab.agent.flux.rpc.GitLabFlux",
	HandlerType: (*GitLabFluxServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ReconcileProjects",
			Handler:       _GitLabFlux_ReconcileProjects_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "internal/module/flux/rpc/rpc.proto",
}
