Skip to content

Git designed for AI agents.

6.6 KB
Raw Blame
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v6.30.2
// source: analysis.proto

package gitalypb

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 (
	AnalysisService_CheckBlobsGenerated_FullMethodName = "/gitaly.AnalysisService/CheckBlobsGenerated"
)

// AnalysisServiceClient is the client API for AnalysisService 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.
//
// AnalysisService is a gRPC service providing RPCs that analyze objects in a repository.
type AnalysisServiceClient interface {
	// CheckBlobsGenerated checks a provided set of blobs in a specified repository to determine
	// whether the file is considered generated. This RPC supports bidirectional streaming because the
	// client may specify any number of files to check across multiple request messages and the server
	// responds to each request with a separate set of response messages.
	//
	// Each provided blob in the request is validated when received. Improperly formatted requests
	// result in RPC termination and an error being returned to the client. The RPC also aborts and
	// returns an error if requests are made that list Git revisions which do not resolve to a blob
	// and/or cannot be found in the repository.
	CheckBlobsGenerated(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CheckBlobsGeneratedRequest, CheckBlobsGeneratedResponse], error)
}

type analysisServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAnalysisServiceClient(cc grpc.ClientConnInterface) AnalysisServiceClient {
	return &analysisServiceClient{cc}
}

func (c *analysisServiceClient) CheckBlobsGenerated(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CheckBlobsGeneratedRequest, CheckBlobsGeneratedResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &AnalysisService_ServiceDesc.Streams[0], AnalysisService_CheckBlobsGenerated_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[CheckBlobsGeneratedRequest, CheckBlobsGeneratedResponse]{ClientStream: stream}
	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 AnalysisService_CheckBlobsGeneratedClient = grpc.BidiStreamingClient[CheckBlobsGeneratedRequest, CheckBlobsGeneratedResponse]

// AnalysisServiceServer is the server API for AnalysisService service.
// All implementations must embed UnimplementedAnalysisServiceServer
// for forward compatibility.
//
// AnalysisService is a gRPC service providing RPCs that analyze objects in a repository.
type AnalysisServiceServer interface {
	// CheckBlobsGenerated checks a provided set of blobs in a specified repository to determine
	// whether the file is considered generated. This RPC supports bidirectional streaming because the
	// client may specify any number of files to check across multiple request messages and the server
	// responds to each request with a separate set of response messages.
	//
	// Each provided blob in the request is validated when received. Improperly formatted requests
	// result in RPC termination and an error being returned to the client. The RPC also aborts and
	// returns an error if requests are made that list Git revisions which do not resolve to a blob
	// and/or cannot be found in the repository.
	CheckBlobsGenerated(grpc.BidiStreamingServer[CheckBlobsGeneratedRequest, CheckBlobsGeneratedResponse]) error
	mustEmbedUnimplementedAnalysisServiceServer()
}

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

func (UnimplementedAnalysisServiceServer) CheckBlobsGenerated(grpc.BidiStreamingServer[CheckBlobsGeneratedRequest, CheckBlobsGeneratedResponse]) error {
	return status.Error(codes.Unimplemented, "method CheckBlobsGenerated not implemented")
}
func (UnimplementedAnalysisServiceServer) mustEmbedUnimplementedAnalysisServiceServer() {}
func (UnimplementedAnalysisServiceServer) testEmbeddedByValue()                         {}

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

func RegisterAnalysisServiceServer(s grpc.ServiceRegistrar, srv AnalysisServiceServer) {
	// If the following call panics, it indicates UnimplementedAnalysisServiceServer 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(&AnalysisService_ServiceDesc, srv)
}

func _AnalysisService_CheckBlobsGenerated_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(AnalysisServiceServer).CheckBlobsGenerated(&grpc.GenericServerStream[CheckBlobsGeneratedRequest, CheckBlobsGeneratedResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AnalysisService_CheckBlobsGeneratedServer = grpc.BidiStreamingServer[CheckBlobsGeneratedRequest, CheckBlobsGeneratedResponse]

// AnalysisService_ServiceDesc is the grpc.ServiceDesc for AnalysisService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AnalysisService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitaly.AnalysisService",
	HandlerType: (*AnalysisServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CheckBlobsGenerated",
			Handler:       _AnalysisService_CheckBlobsGenerated_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "analysis.proto",
}