Documentation ¶
Index ¶
- func NewServer(conf config.Config, logger log.Logger, rs datastore.RepositoryStore, ...) gitalypb.PraefectInfoServiceServer
- type AssignmentStore
- type PrimaryGetter
- type Server
- func (s *Server) Dataloss(req *gitalypb.DatalossRequest, ...) error
- func (s *Server) GetRepositoryMetadata(ctx context.Context, req *gitalypb.GetRepositoryMetadataRequest) (*gitalypb.GetRepositoryMetadataResponse, error)
- func (s *Server) MarkUnverified(ctx context.Context, req *gitalypb.MarkUnverifiedRequest) (*gitalypb.MarkUnverifiedResponse, error)
- func (s *Server) RepositoryReplicas(ctx context.Context, in *gitalypb.RepositoryReplicasRequest) (*gitalypb.RepositoryReplicasResponse, error)
- func (s *Server) SetAuthoritativeStorage(ctx context.Context, req *gitalypb.SetAuthoritativeStorageRequest) (*gitalypb.SetAuthoritativeStorageResponse, error)
- func (s *Server) SetReplicationFactor(ctx context.Context, req *gitalypb.SetReplicationFactorRequest) (*gitalypb.SetReplicationFactorResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer( conf config.Config, logger log.Logger, rs datastore.RepositoryStore, assignmentStore AssignmentStore, conns service.Connections, primaryGetter PrimaryGetter, ) gitalypb.PraefectInfoServiceServer
NewServer creates a new instance of a grpc InfoServiceServer
Types ¶
type AssignmentStore ¶
type AssignmentStore interface { // GetHostAssignments returns the names of the storages assigned to host the repository. // The primary node must always be assigned. GetHostAssignments(ctx context.Context, virtualStorage string, repositoryID int64) ([]string, error) // SetReplicationFactor sets a repository's replication factor and returns the current assignments. SetReplicationFactor(ctx context.Context, virtualStorage, relativePath string, replicationFactor int) ([]string, error) }
AssignmentStore is an interface for getting repository host node assignments.
This duplicates the praefect.AssignmentGetter type as it is not possible to import anything from `praefect` to `info` packages due to cyclic dependencies.
type PrimaryGetter ¶
type PrimaryGetter interface { // GetPrimary returns the primary storage for a given repository. GetPrimary(ctx context.Context, virtualStorage string, repositoryID int64) (string, error) }
PrimaryGetter is an interface for getting a primary of a repository.
This duplicates the praefect.PrimaryGetter type as it is not possible to import anything from `praefect` to `info` packages due to cyclic dependencies.
type Server ¶
type Server struct { gitalypb.UnimplementedPraefectInfoServiceServer // contains filtered or unexported fields }
Server is a InfoService server
func (*Server) Dataloss ¶ added in v16.4.0
func (s *Server) Dataloss( req *gitalypb.DatalossRequest, stream gitalypb.PraefectInfoService_DatalossServer, ) error
Dataloss implements the Dataloss RPC to return data about repositories that are outdated.
func (*Server) GetRepositoryMetadata ¶
func (s *Server) GetRepositoryMetadata(ctx context.Context, req *gitalypb.GetRepositoryMetadataRequest) (*gitalypb.GetRepositoryMetadataResponse, error)
GetRepositoryMetadata returns the cluster metadata for a repository.
func (*Server) MarkUnverified ¶
func (s *Server) MarkUnverified(ctx context.Context, req *gitalypb.MarkUnverifiedRequest) (*gitalypb.MarkUnverifiedResponse, error)
MarkUnverified marks replicas as unverified. See the protobuf declarations for details.
func (*Server) RepositoryReplicas ¶
func (s *Server) RepositoryReplicas(ctx context.Context, in *gitalypb.RepositoryReplicasRequest) (*gitalypb.RepositoryReplicasResponse, error)
RepositoryReplicas returns a list of repositories that includes the checksum of the primary as well as the replicas
func (*Server) SetAuthoritativeStorage ¶
func (s *Server) SetAuthoritativeStorage(ctx context.Context, req *gitalypb.SetAuthoritativeStorageRequest) (*gitalypb.SetAuthoritativeStorageResponse, error)
func (*Server) SetReplicationFactor ¶
func (s *Server) SetReplicationFactor(ctx context.Context, req *gitalypb.SetReplicationFactorRequest) (*gitalypb.SetReplicationFactorResponse, error)