Skip to content

Git designed for AI agents.

18.4 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: storage_core.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 (
	StorageCoreService_ImportRepository_FullMethodName           = "/gitaly.StorageCoreService/ImportRepository"
	StorageCoreService_GetStorageState_FullMethodName            = "/gitaly.StorageCoreService/GetStorageState"
	StorageCoreService_VerifyRepository_FullMethodName           = "/gitaly.StorageCoreService/VerifyRepository"
	StorageCoreService_CreateCheckpoint_FullMethodName           = "/gitaly.StorageCoreService/CreateCheckpoint"
	StorageCoreService_CollectGarbage_FullMethodName             = "/gitaly.StorageCoreService/CollectGarbage"
	StorageCoreService_CollectRemovedRepositories_FullMethodName = "/gitaly.StorageCoreService/CollectRemovedRepositories"
)

// StorageCoreServiceClient is the client API for StorageCoreService 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.
//
// StorageCoreService administers the Graft storage core: the repository state
// kept in a strongly consistent database plus object storage, with the local
// git repositories of the nodes as caches (doc/graft/STORAGE.md). Its RPCs are
// for operators; agents may not call them.
type StorageCoreServiceClient interface {
	// ImportRepository registers a local repository that the storage core does
	// not know yet: its changelog history and reviews with the registration,
	// then one pack with every object reachable from its references, then
	// changeset 1 with all its references. A failed or interrupted import is
	// resumed by calling it again. On a repository that is already tracked it
	// brings the changelog entries and reviews written in the local files since
	// the import into the database (the step of switching from shadow to
	// authoritative mode) and leaves the references alone. It fails with
	// FailedPrecondition when the storage core is off.
	ImportRepository(ctx context.Context, in *ImportRepositoryRequest, opts ...grpc.CallOption) (*ImportRepositoryResponse, error)
	// GetStorageState returns how the storage core sees the repository and how
	// far this node's local copy is.
	GetStorageState(ctx context.Context, in *GetStorageStateRequest, opts ...grpc.CallOption) (*GetStorageStateResponse, error)
	// VerifyRepository compares the local references with the database and
	// optionally checks the connectivity of the local repository. In
	// authoritative mode the local repository is caught up first.
	VerifyRepository(ctx context.Context, in *VerifyRepositoryRequest, opts ...grpc.CallOption) (*VerifyRepositoryResponse, error)
	// CreateCheckpoint builds a checkpoint of the repository at its current
	// database head and records it: one pack of every object reachable from the
	// references at the head, with the reference snapshot, so that hydration
	// starts from it and garbage collection can delete the packs it covers. It
	// fails with FailedPrecondition outside authoritative mode.
	CreateCheckpoint(ctx context.Context, in *CreateCheckpointRequest, opts ...grpc.CallOption) (*CreateCheckpointResponse, error)
	// CollectGarbage deletes the packs of the repository that no reader needs
	// any more: the objects no row references once they were observed so at
	// least gc_grace ago, the changeset packs covered by a checkpoint at least
	// gc_grace old, and the checkpoints that one supersedes. It touches no other
	// repository. It fails with FailedPrecondition when the storage core is off,
	// or while another maintenance of the repository holds its lease.
	CollectGarbage(ctx context.Context, in *CollectGarbageRequest, opts ...grpc.CallOption) (*CollectGarbageResponse, error)
	// CollectRemovedRepositories deletes every object of the repositories of a
	// storage that were removed at least gc_grace ago. It first reconciles the
	// bucket: a repository ID with objects and neither a row nor a tombstone
	// gets a tombstone. It fails with FailedPrecondition when the storage core
	// is off.
	CollectRemovedRepositories(ctx context.Context, in *CollectRemovedRepositoriesRequest, opts ...grpc.CallOption) (*CollectRemovedRepositoriesResponse, error)
}

type storageCoreServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewStorageCoreServiceClient(cc grpc.ClientConnInterface) StorageCoreServiceClient {
	return &storageCoreServiceClient{cc}
}

func (c *storageCoreServiceClient) ImportRepository(ctx context.Context, in *ImportRepositoryRequest, opts ...grpc.CallOption) (*ImportRepositoryResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ImportRepositoryResponse)
	err := c.cc.Invoke(ctx, StorageCoreService_ImportRepository_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageCoreServiceClient) GetStorageState(ctx context.Context, in *GetStorageStateRequest, opts ...grpc.CallOption) (*GetStorageStateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetStorageStateResponse)
	err := c.cc.Invoke(ctx, StorageCoreService_GetStorageState_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageCoreServiceClient) VerifyRepository(ctx context.Context, in *VerifyRepositoryRequest, opts ...grpc.CallOption) (*VerifyRepositoryResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(VerifyRepositoryResponse)
	err := c.cc.Invoke(ctx, StorageCoreService_VerifyRepository_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageCoreServiceClient) CreateCheckpoint(ctx context.Context, in *CreateCheckpointRequest, opts ...grpc.CallOption) (*CreateCheckpointResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CreateCheckpointResponse)
	err := c.cc.Invoke(ctx, StorageCoreService_CreateCheckpoint_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageCoreServiceClient) CollectGarbage(ctx context.Context, in *CollectGarbageRequest, opts ...grpc.CallOption) (*CollectGarbageResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CollectGarbageResponse)
	err := c.cc.Invoke(ctx, StorageCoreService_CollectGarbage_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageCoreServiceClient) CollectRemovedRepositories(ctx context.Context, in *CollectRemovedRepositoriesRequest, opts ...grpc.CallOption) (*CollectRemovedRepositoriesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CollectRemovedRepositoriesResponse)
	err := c.cc.Invoke(ctx, StorageCoreService_CollectRemovedRepositories_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// StorageCoreServiceServer is the server API for StorageCoreService service.
// All implementations must embed UnimplementedStorageCoreServiceServer
// for forward compatibility.
//
// StorageCoreService administers the Graft storage core: the repository state
// kept in a strongly consistent database plus object storage, with the local
// git repositories of the nodes as caches (doc/graft/STORAGE.md). Its RPCs are
// for operators; agents may not call them.
type StorageCoreServiceServer interface {
	// ImportRepository registers a local repository that the storage core does
	// not know yet: its changelog history and reviews with the registration,
	// then one pack with every object reachable from its references, then
	// changeset 1 with all its references. A failed or interrupted import is
	// resumed by calling it again. On a repository that is already tracked it
	// brings the changelog entries and reviews written in the local files since
	// the import into the database (the step of switching from shadow to
	// authoritative mode) and leaves the references alone. It fails with
	// FailedPrecondition when the storage core is off.
	ImportRepository(context.Context, *ImportRepositoryRequest) (*ImportRepositoryResponse, error)
	// GetStorageState returns how the storage core sees the repository and how
	// far this node's local copy is.
	GetStorageState(context.Context, *GetStorageStateRequest) (*GetStorageStateResponse, error)
	// VerifyRepository compares the local references with the database and
	// optionally checks the connectivity of the local repository. In
	// authoritative mode the local repository is caught up first.
	VerifyRepository(context.Context, *VerifyRepositoryRequest) (*VerifyRepositoryResponse, error)
	// CreateCheckpoint builds a checkpoint of the repository at its current
	// database head and records it: one pack of every object reachable from the
	// references at the head, with the reference snapshot, so that hydration
	// starts from it and garbage collection can delete the packs it covers. It
	// fails with FailedPrecondition outside authoritative mode.
	CreateCheckpoint(context.Context, *CreateCheckpointRequest) (*CreateCheckpointResponse, error)
	// CollectGarbage deletes the packs of the repository that no reader needs
	// any more: the objects no row references once they were observed so at
	// least gc_grace ago, the changeset packs covered by a checkpoint at least
	// gc_grace old, and the checkpoints that one supersedes. It touches no other
	// repository. It fails with FailedPrecondition when the storage core is off,
	// or while another maintenance of the repository holds its lease.
	CollectGarbage(context.Context, *CollectGarbageRequest) (*CollectGarbageResponse, error)
	// CollectRemovedRepositories deletes every object of the repositories of a
	// storage that were removed at least gc_grace ago. It first reconciles the
	// bucket: a repository ID with objects and neither a row nor a tombstone
	// gets a tombstone. It fails with FailedPrecondition when the storage core
	// is off.
	CollectRemovedRepositories(context.Context, *CollectRemovedRepositoriesRequest) (*CollectRemovedRepositoriesResponse, error)
	mustEmbedUnimplementedStorageCoreServiceServer()
}

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

func (UnimplementedStorageCoreServiceServer) ImportRepository(context.Context, *ImportRepositoryRequest) (*ImportRepositoryResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ImportRepository not implemented")
}
func (UnimplementedStorageCoreServiceServer) GetStorageState(context.Context, *GetStorageStateRequest) (*GetStorageStateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method GetStorageState not implemented")
}
func (UnimplementedStorageCoreServiceServer) VerifyRepository(context.Context, *VerifyRepositoryRequest) (*VerifyRepositoryResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method VerifyRepository not implemented")
}
func (UnimplementedStorageCoreServiceServer) CreateCheckpoint(context.Context, *CreateCheckpointRequest) (*CreateCheckpointResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CreateCheckpoint not implemented")
}
func (UnimplementedStorageCoreServiceServer) CollectGarbage(context.Context, *CollectGarbageRequest) (*CollectGarbageResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CollectGarbage not implemented")
}
func (UnimplementedStorageCoreServiceServer) CollectRemovedRepositories(context.Context, *CollectRemovedRepositoriesRequest) (*CollectRemovedRepositoriesResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CollectRemovedRepositories not implemented")
}
func (UnimplementedStorageCoreServiceServer) mustEmbedUnimplementedStorageCoreServiceServer() {}
func (UnimplementedStorageCoreServiceServer) testEmbeddedByValue()                            {}

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

func RegisterStorageCoreServiceServer(s grpc.ServiceRegistrar, srv StorageCoreServiceServer) {
	// If the following call panics, it indicates UnimplementedStorageCoreServiceServer 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(&StorageCoreService_ServiceDesc, srv)
}

func _StorageCoreService_ImportRepository_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ImportRepositoryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageCoreServiceServer).ImportRepository(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageCoreService_ImportRepository_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageCoreServiceServer).ImportRepository(ctx, req.(*ImportRepositoryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageCoreService_GetStorageState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetStorageStateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageCoreServiceServer).GetStorageState(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageCoreService_GetStorageState_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageCoreServiceServer).GetStorageState(ctx, req.(*GetStorageStateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageCoreService_VerifyRepository_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(VerifyRepositoryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageCoreServiceServer).VerifyRepository(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageCoreService_VerifyRepository_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageCoreServiceServer).VerifyRepository(ctx, req.(*VerifyRepositoryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageCoreService_CreateCheckpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateCheckpointRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageCoreServiceServer).CreateCheckpoint(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageCoreService_CreateCheckpoint_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageCoreServiceServer).CreateCheckpoint(ctx, req.(*CreateCheckpointRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageCoreService_CollectGarbage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CollectGarbageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageCoreServiceServer).CollectGarbage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageCoreService_CollectGarbage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageCoreServiceServer).CollectGarbage(ctx, req.(*CollectGarbageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageCoreService_CollectRemovedRepositories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CollectRemovedRepositoriesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageCoreServiceServer).CollectRemovedRepositories(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageCoreService_CollectRemovedRepositories_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageCoreServiceServer).CollectRemovedRepositories(ctx, req.(*CollectRemovedRepositoriesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// StorageCoreService_ServiceDesc is the grpc.ServiceDesc for StorageCoreService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var StorageCoreService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitaly.StorageCoreService",
	HandlerType: (*StorageCoreServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ImportRepository",
			Handler:    _StorageCoreService_ImportRepository_Handler,
		},
		{
			MethodName: "GetStorageState",
			Handler:    _StorageCoreService_GetStorageState_Handler,
		},
		{
			MethodName: "VerifyRepository",
			Handler:    _StorageCoreService_VerifyRepository_Handler,
		},
		{
			MethodName: "CreateCheckpoint",
			Handler:    _StorageCoreService_CreateCheckpoint_Handler,
		},
		{
			MethodName: "CollectGarbage",
			Handler:    _StorageCoreService_CollectGarbage_Handler,
		},
		{
			MethodName: "CollectRemovedRepositories",
			Handler:    _StorageCoreService_CollectRemovedRepositories_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "storage_core.proto",
}