// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.21.11
// source: http.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

// SmartHTTPServiceClient is the client API for SmartHTTPService 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 SmartHTTPServiceClient interface {
	// The response body for GET /info/refs?service=git-upload-pack
	// Will be invoked when the user executes a `git fetch`, meaning the server
	// will upload the packs to that user. The user doesn't upload new objects.
	InfoRefs(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTPService_InfoRefsClient, error)
	// ServicePack is just upload-pack or receive-pack
	ServicePack(ctx context.Context, opts ...grpc.CallOption) (SmartHTTPService_ServicePackClient, error)
}

type smartHTTPServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewSmartHTTPServiceClient(cc grpc.ClientConnInterface) SmartHTTPServiceClient {
	return &smartHTTPServiceClient{cc}
}

func (c *smartHTTPServiceClient) InfoRefs(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTPService_InfoRefsClient, error) {
	stream, err := c.cc.NewStream(ctx, &SmartHTTPService_ServiceDesc.Streams[0], "/rpc.SmartHTTPService/InfoRefs", opts...)
	if err != nil {
		return nil, err
	}
	x := &smartHTTPServiceInfoRefsClient{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 SmartHTTPService_InfoRefsClient interface {
	Recv() (*InfoRefsResponse, error)
	grpc.ClientStream
}

type smartHTTPServiceInfoRefsClient struct {
	grpc.ClientStream
}

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

func (c *smartHTTPServiceClient) ServicePack(ctx context.Context, opts ...grpc.CallOption) (SmartHTTPService_ServicePackClient, error) {
	stream, err := c.cc.NewStream(ctx, &SmartHTTPService_ServiceDesc.Streams[1], "/rpc.SmartHTTPService/ServicePack", opts...)
	if err != nil {
		return nil, err
	}
	x := &smartHTTPServiceServicePackClient{stream}
	return x, nil
}

type SmartHTTPService_ServicePackClient interface {
	Send(*ServicePackRequest) error
	Recv() (*ServicePackResponse, error)
	grpc.ClientStream
}

type smartHTTPServiceServicePackClient struct {
	grpc.ClientStream
}

func (x *smartHTTPServiceServicePackClient) Send(m *ServicePackRequest) error {
	return x.ClientStream.SendMsg(m)
}

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

// SmartHTTPServiceServer is the server API for SmartHTTPService service.
// All implementations must embed UnimplementedSmartHTTPServiceServer
// for forward compatibility
type SmartHTTPServiceServer interface {
	// The response body for GET /info/refs?service=git-upload-pack
	// Will be invoked when the user executes a `git fetch`, meaning the server
	// will upload the packs to that user. The user doesn't upload new objects.
	InfoRefs(*InfoRefsRequest, SmartHTTPService_InfoRefsServer) error
	// ServicePack is just upload-pack or receive-pack
	ServicePack(SmartHTTPService_ServicePackServer) error
	mustEmbedUnimplementedSmartHTTPServiceServer()
}

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

func (UnimplementedSmartHTTPServiceServer) InfoRefs(*InfoRefsRequest, SmartHTTPService_InfoRefsServer) error {
	return status.Errorf(codes.Unimplemented, "method InfoRefs not implemented")
}
func (UnimplementedSmartHTTPServiceServer) ServicePack(SmartHTTPService_ServicePackServer) error {
	return status.Errorf(codes.Unimplemented, "method ServicePack not implemented")
}
func (UnimplementedSmartHTTPServiceServer) mustEmbedUnimplementedSmartHTTPServiceServer() {}

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

func RegisterSmartHTTPServiceServer(s grpc.ServiceRegistrar, srv SmartHTTPServiceServer) {
	s.RegisterService(&SmartHTTPService_ServiceDesc, srv)
}

func _SmartHTTPService_InfoRefs_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(InfoRefsRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(SmartHTTPServiceServer).InfoRefs(m, &smartHTTPServiceInfoRefsServer{stream})
}

type SmartHTTPService_InfoRefsServer interface {
	Send(*InfoRefsResponse) error
	grpc.ServerStream
}

type smartHTTPServiceInfoRefsServer struct {
	grpc.ServerStream
}

func (x *smartHTTPServiceInfoRefsServer) Send(m *InfoRefsResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _SmartHTTPService_ServicePack_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(SmartHTTPServiceServer).ServicePack(&smartHTTPServiceServicePackServer{stream})
}

type SmartHTTPService_ServicePackServer interface {
	Send(*ServicePackResponse) error
	Recv() (*ServicePackRequest, error)
	grpc.ServerStream
}

type smartHTTPServiceServicePackServer struct {
	grpc.ServerStream
}

func (x *smartHTTPServiceServicePackServer) Send(m *ServicePackResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *smartHTTPServiceServicePackServer) Recv() (*ServicePackRequest, error) {
	m := new(ServicePackRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// SmartHTTPService_ServiceDesc is the grpc.ServiceDesc for SmartHTTPService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SmartHTTPService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.SmartHTTPService",
	HandlerType: (*SmartHTTPServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "InfoRefs",
			Handler:       _SmartHTTPService_InfoRefs_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ServicePack",
			Handler:       _SmartHTTPService_ServicePack_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "http.proto",
}
