Documentation ¶
Overview ¶
Package praefect is a Gitaly reverse proxy for transparently routing gRPC calls to a set of Gitaly services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStorageLocExists = errors.New("storage location already registered")
ErrStorageLocExists indicates a storage location has already been registered in the proxy for a downstream Gitaly node
Functions ¶
This section is empty.
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 (*Coordinator) RegisterNode ¶
func (c *Coordinator) RegisterNode(storageLoc string, node *grpc.ClientConn)
RegisterNode will direct traffic to the supplied downstream connection when the storage location is encountered.
TODO: Coordinator probably needs to handle dialing, or another entity needs to handle dialing to ensure keep alives and redialing logic exist for when downstream connections are severed.
type Logger ¶
type Logger interface {
Debugf(format string, args ...interface{})
}
Logger is a simple interface that allows loggers to be dependency injected into the praefect server
type Server ¶
type Server struct { *Coordinator // contains filtered or unexported fields }
Server is a praefect server
func NewServer ¶
func NewServer(grpcOpts []grpc.ServerOption, l Logger) *Server
NewServer returns an initialized praefect gPRC proxy server configured with the provided gRPC server options