Skip to content

Git designed for AI agents.

8.0 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: derived.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 (
	DerivedDataService_Blame_FullMethodName       = "/gitaly.DerivedDataService/Blame"
	DerivedDataService_PathHistory_FullMethodName = "/gitaly.DerivedDataService/PathHistory"
)

// DerivedDataServiceClient is the client API for DerivedDataService 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.
//
// DerivedDataService serves history queries backed by derived data: values
// computed once per (commit, path) from the values of the commit's parents,
// persisted, and reused by every later query. Because inputs are immutable
// commits, cached values never need invalidation.
type DerivedDataServiceClient interface {
	// Blame attributes every line of a file at a revision to the commit that
	// last changed it, as structured data.
	Blame(ctx context.Context, in *BlameRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BlameResponse], error)
	// PathHistory returns the commits that changed a path, newest first,
	// following first parents.
	PathHistory(ctx context.Context, in *PathHistoryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PathHistoryResponse], error)
}

type derivedDataServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewDerivedDataServiceClient(cc grpc.ClientConnInterface) DerivedDataServiceClient {
	return &derivedDataServiceClient{cc}
}

func (c *derivedDataServiceClient) Blame(ctx context.Context, in *BlameRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BlameResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &DerivedDataService_ServiceDesc.Streams[0], DerivedDataService_Blame_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[BlameRequest, BlameResponse]{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 DerivedDataService_BlameClient = grpc.ServerStreamingClient[BlameResponse]

func (c *derivedDataServiceClient) PathHistory(ctx context.Context, in *PathHistoryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PathHistoryResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &DerivedDataService_ServiceDesc.Streams[1], DerivedDataService_PathHistory_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[PathHistoryRequest, PathHistoryResponse]{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 DerivedDataService_PathHistoryClient = grpc.ServerStreamingClient[PathHistoryResponse]

// DerivedDataServiceServer is the server API for DerivedDataService service.
// All implementations must embed UnimplementedDerivedDataServiceServer
// for forward compatibility.
//
// DerivedDataService serves history queries backed by derived data: values
// computed once per (commit, path) from the values of the commit's parents,
// persisted, and reused by every later query. Because inputs are immutable
// commits, cached values never need invalidation.
type DerivedDataServiceServer interface {
	// Blame attributes every line of a file at a revision to the commit that
	// last changed it, as structured data.
	Blame(*BlameRequest, grpc.ServerStreamingServer[BlameResponse]) error
	// PathHistory returns the commits that changed a path, newest first,
	// following first parents.
	PathHistory(*PathHistoryRequest, grpc.ServerStreamingServer[PathHistoryResponse]) error
	mustEmbedUnimplementedDerivedDataServiceServer()
}

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

func (UnimplementedDerivedDataServiceServer) Blame(*BlameRequest, grpc.ServerStreamingServer[BlameResponse]) error {
	return status.Error(codes.Unimplemented, "method Blame not implemented")
}
func (UnimplementedDerivedDataServiceServer) PathHistory(*PathHistoryRequest, grpc.ServerStreamingServer[PathHistoryResponse]) error {
	return status.Error(codes.Unimplemented, "method PathHistory not implemented")
}
func (UnimplementedDerivedDataServiceServer) mustEmbedUnimplementedDerivedDataServiceServer() {}
func (UnimplementedDerivedDataServiceServer) testEmbeddedByValue()                            {}

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

func RegisterDerivedDataServiceServer(s grpc.ServiceRegistrar, srv DerivedDataServiceServer) {
	// If the following call panics, it indicates UnimplementedDerivedDataServiceServer 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(&DerivedDataService_ServiceDesc, srv)
}

func _DerivedDataService_Blame_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(BlameRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(DerivedDataServiceServer).Blame(m, &grpc.GenericServerStream[BlameRequest, BlameResponse]{ServerStream: stream})
}

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

func _DerivedDataService_PathHistory_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(PathHistoryRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(DerivedDataServiceServer).PathHistory(m, &grpc.GenericServerStream[PathHistoryRequest, PathHistoryResponse]{ServerStream: stream})
}

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

// DerivedDataService_ServiceDesc is the grpc.ServiceDesc for DerivedDataService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DerivedDataService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitaly.DerivedDataService",
	HandlerType: (*DerivedDataServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Blame",
			Handler:       _DerivedDataService_Blame_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "PathHistory",
			Handler:       _DerivedDataService_PathHistory_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "derived.proto",
}