server

package
v16.0.9-rc42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitalyServerFactory

type GitalyServerFactory struct {
	// contains filtered or unexported fields
}

GitalyServerFactory is a factory of gitaly grpc servers

func NewGitalyServerFactory

func NewGitalyServerFactory(
	cfg config.Cfg,
	logger *logrus.Entry,
	registry *backchannel.Registry,
	cacheInvalidator cache.Invalidator,
	limitHandlers []*limithandler.LimiterMiddleware,
) *GitalyServerFactory

NewGitalyServerFactory allows to create and start secure/insecure 'grpc.Server's.

func (*GitalyServerFactory) CreateExternal

func (s *GitalyServerFactory) CreateExternal(secure bool, opts ...Option) (*grpc.Server, error)

CreateExternal creates a new external gRPC server. The external servers are closed before the internal servers when gracefully shutting down.

func (*GitalyServerFactory) CreateInternal

func (s *GitalyServerFactory) CreateInternal(opts ...Option) (*grpc.Server, error)

CreateInternal creates a new internal gRPC server. Internal servers are closed after the external ones when gracefully shutting down.

func (*GitalyServerFactory) GracefulStop

func (s *GitalyServerFactory) GracefulStop()

GracefulStop gracefully stops all servers created by the GitalyServerFactory. ExternalServers are stopped before the internal servers to ensure any RPCs accepted by the externals servers can still complete their requests to the internal servers. This is important for hooks calling back to Gitaly.

func (*GitalyServerFactory) New

func (s *GitalyServerFactory) New(secure bool, opts ...Option) (*grpc.Server, error)

New returns a GRPC server instance with a set of interceptors configured.

func (*GitalyServerFactory) Stop

func (s *GitalyServerFactory) Stop()

Stop immediately stops all servers created by the GitalyServerFactory.

type Option

type Option func(*serverConfig)

Option is an option that can be passed to `New()`.

func WithStreamInterceptor

func WithStreamInterceptor(interceptor grpc.StreamServerInterceptor) Option

WithStreamInterceptor adds another interceptor that shall be executed for streaming RPC calls.

func WithUnaryInterceptor

func WithUnaryInterceptor(interceptor grpc.UnaryServerInterceptor) Option

WithUnaryInterceptor adds another interceptor that shall be executed for unary RPC calls.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL