Documentation ¶
Index ¶
- func IsHealthy(conn *grpc.ClientConn, timeout time.Duration) bool
- func RunGitalyServer(t testing.TB, cfg config.Cfg, rubyServer *rubyserver.Server, ...) string
- type GitalyServer
- type GitalyServerOpt
- func WithBackchannelRegistry(backchannelReg *backchannel.Registry) GitalyServerOpt
- func WithDisablePraefect() GitalyServerOpt
- func WithDiskCache(diskCache cache.Cache) GitalyServerOpt
- func WithGitLabClient(gitlabClient gitlab.Client) GitalyServerOpt
- func WithHookManager(hookMgr hook.Manager) GitalyServerOpt
- func WithLocator(locator storage.Locator) GitalyServerOpt
- func WithLogger(logger *logrus.Logger) GitalyServerOpt
- func WithTransactionManager(txMgr transaction.Manager) GitalyServerOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsHealthy ¶
func IsHealthy(conn *grpc.ClientConn, timeout time.Duration) bool
IsHealthy creates a health client to passed in connection and send `Check` request. It waits for `timeout` duration to get response back. It returns `true` only if remote responds with `SERVING` status.
func RunGitalyServer ¶
func RunGitalyServer(t testing.TB, cfg config.Cfg, rubyServer *rubyserver.Server, registrar func(srv *grpc.Server, deps *service.Dependencies), opts ...GitalyServerOpt) string
RunGitalyServer starts gitaly server based on the provided cfg and returns a connection address. It accepts addition Registrar to register all required service instead of calling service.RegisterAll explicitly because it creates a circular dependency when the function is used in on of internal/gitaly/service/... packages.
Types ¶
type GitalyServer ¶
type GitalyServer struct {
// contains filtered or unexported fields
}
GitalyServer is a helper that carries additional info and functionality about gitaly (+praefect) server.
func StartGitalyServer ¶
func StartGitalyServer(t testing.TB, cfg config.Cfg, rubyServer *rubyserver.Server, registrar func(srv *grpc.Server, deps *service.Dependencies), opts ...GitalyServerOpt) GitalyServer
StartGitalyServer creates and runs gitaly (and praefect as a proxy) server.
func (GitalyServer) Address ¶
func (gs GitalyServer) Address() string
Address returns address of the running gitaly (or praefect) service.
func (GitalyServer) Shutdown ¶
func (gs GitalyServer) Shutdown()
Shutdown terminates running gitaly (+praefect) server.
type GitalyServerOpt ¶
type GitalyServerOpt func(gitalyServerDeps) gitalyServerDeps
GitalyServerOpt is a helper type to shorten declarations.
func WithBackchannelRegistry ¶
func WithBackchannelRegistry(backchannelReg *backchannel.Registry) GitalyServerOpt
WithBackchannelRegistry sets backchannel.Registry instance that will be used for gitaly services initialisation.
func WithDisablePraefect ¶
func WithDisablePraefect() GitalyServerOpt
WithDisablePraefect disables setup and usage of the praefect as a proxy before the gitaly service.
func WithDiskCache ¶ added in v14.1.0
func WithDiskCache(diskCache cache.Cache) GitalyServerOpt
WithDiskCache sets the cache.Cache instance that will be used for gitaly services initialisation.
func WithGitLabClient ¶
func WithGitLabClient(gitlabClient gitlab.Client) GitalyServerOpt
WithGitLabClient sets gitlab.Client instance that will be used for gitaly services initialisation.
func WithHookManager ¶
func WithHookManager(hookMgr hook.Manager) GitalyServerOpt
WithHookManager sets hook.Manager instance that will be used for gitaly services initialisation.
func WithLocator ¶
func WithLocator(locator storage.Locator) GitalyServerOpt
WithLocator sets a storage.Locator instance that will be used for gitaly services initialisation.
func WithLogger ¶
func WithLogger(logger *logrus.Logger) GitalyServerOpt
WithLogger sets a logrus.Logger instance that will be used for gitaly services initialisation.
func WithTransactionManager ¶
func WithTransactionManager(txMgr transaction.Manager) GitalyServerOpt
WithTransactionManager sets transaction.Manager instance that will be used for gitaly services initialisation.