Documentation ¶
Overview ¶
Package praefect is a Gitaly reverse proxy for transparently routing gRPC calls to a set of Gitaly services.
Index ¶
- Variables
- func GetBuildTime() string
- func GetVersion() string
- func GetVersionString() string
- func WithLatencyMetric(h metrics.Histogram) func(*ReplMgr)
- func WithQueueMetric(g metrics.Gauge) func(*ReplMgr)
- type Coordinator
- type Node
- type NodeManager
- type NodeMgr
- type ReplMgr
- type ReplMgrOpt
- type Replicator
- type Server
- type Shard
Constants ¶
This section is empty.
Variables ¶
var ErrPrimaryNotHealthy = errors.New("primary is not healthy")
ErrPrimaryNotHealthy indicates the primary of a shard is not in a healthy state and hence should not be used for a new request
Functions ¶
func GetBuildTime ¶ added in v1.53.0
func GetBuildTime() string
GetBuildTime returns the time at which the build took place
func GetVersion ¶ added in v1.53.0
func GetVersion() string
GetVersion returns the semver compatible version number
func GetVersionString ¶ added in v1.53.0
func GetVersionString() string
GetVersionString returns a standard version header
func WithLatencyMetric ¶ added in v1.79.0
WithLatencyMetric is an option to set the queue size prometheus metric
func WithQueueMetric ¶ added in v1.79.0
WithQueueMetric is an option to set the queue size prometheus metric
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator takes care of directing client requests to the appropriate downstream server. The coordinator is thread safe; concurrent calls to register nodes are safe.
func NewCoordinator ¶ added in v1.34.0
func NewCoordinator(l *logrus.Entry, ds datastore.Datastore, clientConnections *conn.ClientConnections, conf config.Config, fileDescriptors ...*descriptor.FileDescriptorProto) *Coordinator
NewCoordinator returns a new Coordinator that utilizes the provided logger
func (*Coordinator) FailoverRotation ¶ added in v1.56.0
func (c *Coordinator) FailoverRotation()
FailoverRotation waits for the SIGUSR1 signal, then promotes the next secondary to be primary
func (*Coordinator) RegisterProtos ¶ added in v1.35.1
func (c *Coordinator) RegisterProtos(protos ...*descriptor.FileDescriptorProto) error
RegisterProtos allows coordinator to register new protos on the fly
type Node ¶ added in v1.34.0
type Node interface { GetStorage() string GetAddress() string GetToken() string GetConnection() *grpc.ClientConn }
Node represents some metadata of a node as well as a connection
type NodeManager ¶ added in v1.86.0
NodeManager is responsible for returning shards for virtual storages
type NodeMgr ¶ added in v1.86.0
type NodeMgr struct {
// contains filtered or unexported fields
}
NodeMgr is a concrete type that adheres to the NodeManager interface
func NewNodeManager ¶ added in v1.86.0
NewNodeManager creates a new NodeMgr based on virtual storage configs
type ReplMgr ¶ added in v1.34.0
type ReplMgr struct {
// contains filtered or unexported fields
}
ReplMgr is a replication manager for handling replication jobs
func NewReplMgr ¶ added in v1.34.0
func NewReplMgr(targetNode string, log *logrus.Entry, datastore datastore.Datastore, c *conn.ClientConnections, opts ...ReplMgrOpt) ReplMgr
NewReplMgr initializes a replication manager with the provided dependencies and options
type ReplMgrOpt ¶ added in v1.34.0
type ReplMgrOpt func(*ReplMgr)
ReplMgrOpt allows a replicator to be configured with additional options
func WithReplicator ¶ added in v1.34.0
func WithReplicator(r Replicator) ReplMgrOpt
WithReplicator overrides the default replicator
func WithWhitelist ¶ added in v1.34.0
func WithWhitelist(whitelistedRepos []string) ReplMgrOpt
WithWhitelist will configure a whitelist for repos to allow replication
type Replicator ¶ added in v1.34.0
type Replicator interface { // Replicate propagates changes from the source to the target Replicate(ctx context.Context, job datastore.ReplJob, source, target *grpc.ClientConn) error // Destroy will remove the target repo on the specified target connection Destroy(ctx context.Context, job datastore.ReplJob, target *grpc.ClientConn) error }
Replicator performs the actual replication logic between two nodes
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a praefect server
func NewServer ¶
func NewServer(c *Coordinator, repl ReplMgr, grpcOpts []grpc.ServerOption, l *logrus.Entry, clientConnections *conn.ClientConnections, conf config.Config) *Server
NewServer returns an initialized praefect gPRC proxy server configured with the provided gRPC server options
func (*Server) GracefulStop ¶ added in v1.75.0
func (srv *Server) GracefulStop()
GracefulStop stops the praefect server gracefully
func (*Server) RegisterServices ¶ added in v1.75.0
func (srv *Server) RegisterServices()
RegisterServices will register any services praefect needs to handle rpcs on its own
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package datastore provides data models and datastore persistence abstractions for tracking the state of repository replicas.
|
Package datastore provides data models and datastore persistence abstractions for tracking the state of repository replicas. |
grpc-proxy
|
|
proxy
Package proxy provides a reverse proxy handler for gRPC.
|
Package proxy provides a reverse proxy handler for gRPC. |
service
|
|