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

package gitmirrorv1

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	GitMirrorService_CommitLog_FullMethodName  = "/gitmirror.v1.GitMirrorService/CommitLog"
	GitMirrorService_GetBlob_FullMethodName    = "/gitmirror.v1.GitMirrorService/GetBlob"
	GitMirrorService_Diff_FullMethodName       = "/gitmirror.v1.GitMirrorService/Diff"
	GitMirrorService_Interdiff_FullMethodName  = "/gitmirror.v1.GitMirrorService/Interdiff"
	GitMirrorService_MergeCheck_FullMethodName = "/gitmirror.v1.GitMirrorService/MergeCheck"
	GitMirrorService_ResolveRev_FullMethodName = "/gitmirror.v1.GitMirrorService/ResolveRev"
)

// GitMirrorServiceClient is the client API for GitMirrorService 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 GitMirrorServiceClient interface {
	CommitLog(ctx context.Context, in *CommitLogRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CommitLogResponse], error)
	GetBlob(ctx context.Context, in *GetBlobRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BlobChunk], error)
	Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileDiff], error)
	Interdiff(ctx context.Context, in *InterdiffRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileDiff], error)
	MergeCheck(ctx context.Context, in *MergeCheckRequest, opts ...grpc.CallOption) (*MergeCheckResponse, error)
	ResolveRev(ctx context.Context, in *ResolveRevRequest, opts ...grpc.CallOption) (*ResolveRevResponse, error)
}

type gitMirrorServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewGitMirrorServiceClient(cc grpc.ClientConnInterface) GitMirrorServiceClient {
	return &gitMirrorServiceClient{cc}
}

func (c *gitMirrorServiceClient) CommitLog(ctx context.Context, in *CommitLogRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CommitLogResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &GitMirrorService_ServiceDesc.Streams[0], GitMirrorService_CommitLog_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[CommitLogRequest, CommitLogResponse]{ClientStream: 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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitMirrorService_CommitLogClient = grpc.ServerStreamingClient[CommitLogResponse]

func (c *gitMirrorServiceClient) GetBlob(ctx context.Context, in *GetBlobRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BlobChunk], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &GitMirrorService_ServiceDesc.Streams[1], GitMirrorService_GetBlob_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[GetBlobRequest, BlobChunk]{ClientStream: 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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitMirrorService_GetBlobClient = grpc.ServerStreamingClient[BlobChunk]

func (c *gitMirrorServiceClient) Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileDiff], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &GitMirrorService_ServiceDesc.Streams[2], GitMirrorService_Diff_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[DiffRequest, FileDiff]{ClientStream: 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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitMirrorService_DiffClient = grpc.ServerStreamingClient[FileDiff]

func (c *gitMirrorServiceClient) Interdiff(ctx context.Context, in *InterdiffRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileDiff], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &GitMirrorService_ServiceDesc.Streams[3], GitMirrorService_Interdiff_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[InterdiffRequest, FileDiff]{ClientStream: 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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitMirrorService_InterdiffClient = grpc.ServerStreamingClient[FileDiff]

func (c *gitMirrorServiceClient) MergeCheck(ctx context.Context, in *MergeCheckRequest, opts ...grpc.CallOption) (*MergeCheckResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(MergeCheckResponse)
	err := c.cc.Invoke(ctx, GitMirrorService_MergeCheck_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gitMirrorServiceClient) ResolveRev(ctx context.Context, in *ResolveRevRequest, opts ...grpc.CallOption) (*ResolveRevResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResolveRevResponse)
	err := c.cc.Invoke(ctx, GitMirrorService_ResolveRev_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// GitMirrorServiceServer is the server API for GitMirrorService service.
// All implementations must embed UnimplementedGitMirrorServiceServer
// for forward compatibility.
type GitMirrorServiceServer interface {
	CommitLog(*CommitLogRequest, grpc.ServerStreamingServer[CommitLogResponse]) error
	GetBlob(*GetBlobRequest, grpc.ServerStreamingServer[BlobChunk]) error
	Diff(*DiffRequest, grpc.ServerStreamingServer[FileDiff]) error
	Interdiff(*InterdiffRequest, grpc.ServerStreamingServer[FileDiff]) error
	MergeCheck(context.Context, *MergeCheckRequest) (*MergeCheckResponse, error)
	ResolveRev(context.Context, *ResolveRevRequest) (*ResolveRevResponse, error)
	mustEmbedUnimplementedGitMirrorServiceServer()
}

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

func (UnimplementedGitMirrorServiceServer) CommitLog(*CommitLogRequest, grpc.ServerStreamingServer[CommitLogResponse]) error {
	return status.Error(codes.Unimplemented, "method CommitLog not implemented")
}
func (UnimplementedGitMirrorServiceServer) GetBlob(*GetBlobRequest, grpc.ServerStreamingServer[BlobChunk]) error {
	return status.Error(codes.Unimplemented, "method GetBlob not implemented")
}
func (UnimplementedGitMirrorServiceServer) Diff(*DiffRequest, grpc.ServerStreamingServer[FileDiff]) error {
	return status.Error(codes.Unimplemented, "method Diff not implemented")
}
func (UnimplementedGitMirrorServiceServer) Interdiff(*InterdiffRequest, grpc.ServerStreamingServer[FileDiff]) error {
	return status.Error(codes.Unimplemented, "method Interdiff not implemented")
}
func (UnimplementedGitMirrorServiceServer) MergeCheck(context.Context, *MergeCheckRequest) (*MergeCheckResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method MergeCheck not implemented")
}
func (UnimplementedGitMirrorServiceServer) ResolveRev(context.Context, *ResolveRevRequest) (*ResolveRevResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ResolveRev not implemented")
}
func (UnimplementedGitMirrorServiceServer) mustEmbedUnimplementedGitMirrorServiceServer() {}
func (UnimplementedGitMirrorServiceServer) testEmbeddedByValue()                          {}

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

func RegisterGitMirrorServiceServer(s grpc.ServiceRegistrar, srv GitMirrorServiceServer) {
	// If the following call panics, it indicates UnimplementedGitMirrorServiceServer 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(&GitMirrorService_ServiceDesc, srv)
}

func _GitMirrorService_CommitLog_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(CommitLogRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GitMirrorServiceServer).CommitLog(m, &grpc.GenericServerStream[CommitLogRequest, CommitLogResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitMirrorService_CommitLogServer = grpc.ServerStreamingServer[CommitLogResponse]

func _GitMirrorService_GetBlob_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetBlobRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GitMirrorServiceServer).GetBlob(m, &grpc.GenericServerStream[GetBlobRequest, BlobChunk]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitMirrorService_GetBlobServer = grpc.ServerStreamingServer[BlobChunk]

func _GitMirrorService_Diff_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(DiffRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GitMirrorServiceServer).Diff(m, &grpc.GenericServerStream[DiffRequest, FileDiff]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitMirrorService_DiffServer = grpc.ServerStreamingServer[FileDiff]

func _GitMirrorService_Interdiff_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(InterdiffRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GitMirrorServiceServer).Interdiff(m, &grpc.GenericServerStream[InterdiffRequest, FileDiff]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitMirrorService_InterdiffServer = grpc.ServerStreamingServer[FileDiff]

func _GitMirrorService_MergeCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(MergeCheckRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GitMirrorServiceServer).MergeCheck(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: GitMirrorService_MergeCheck_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GitMirrorServiceServer).MergeCheck(ctx, req.(*MergeCheckRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GitMirrorService_ResolveRev_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResolveRevRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GitMirrorServiceServer).ResolveRev(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: GitMirrorService_ResolveRev_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GitMirrorServiceServer).ResolveRev(ctx, req.(*ResolveRevRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// GitMirrorService_ServiceDesc is the grpc.ServiceDesc for GitMirrorService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GitMirrorService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitmirror.v1.GitMirrorService",
	HandlerType: (*GitMirrorServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "MergeCheck",
			Handler:    _GitMirrorService_MergeCheck_Handler,
		},
		{
			MethodName: "ResolveRev",
			Handler:    _GitMirrorService_ResolveRev_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CommitLog",
			Handler:       _GitMirrorService_CommitLog_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "GetBlob",
			Handler:       _GitMirrorService_GetBlob_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Diff",
			Handler:       _GitMirrorService_Diff_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Interdiff",
			Handler:       _GitMirrorService_Interdiff_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "gitmirror/v1/gitmirror.proto",
}
