feat: runtime manager

This commit is contained in:
Ilia Denisov
2026-04-28 20:39:18 +02:00
committed by GitHub
parent e0a99b346b
commit a7cee15115
289 changed files with 45660 additions and 2207 deletions
+17 -1
View File
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"maps"
"os"
"os/signal"
"syscall"
@@ -13,6 +14,7 @@ import (
"galaxy/gateway/internal/authn"
"galaxy/gateway/internal/config"
"galaxy/gateway/internal/downstream"
"galaxy/gateway/internal/downstream/lobbyservice"
"galaxy/gateway/internal/downstream/userservice"
"galaxy/gateway/internal/events"
"galaxy/gateway/internal/grpcapi"
@@ -207,8 +209,22 @@ func newAuthenticatedGRPCDependencies(ctx context.Context, cfg config.Config, lo
)
}
lobbyRoutes, closeLobbyServiceRoutes, err := lobbyservice.NewRoutes(cfg.LobbyService.BaseURL)
if err != nil {
return grpcapi.ServerDependencies{}, nil, nil, errors.Join(
fmt.Errorf("build authenticated grpc dependencies: lobby service routes: %w", err),
closeUserServiceRoutes(),
closeRedisClient(),
)
}
allRoutes := make(map[string]downstream.Client, len(userRoutes)+len(lobbyRoutes))
maps.Copy(allRoutes, userRoutes)
maps.Copy(allRoutes, lobbyRoutes)
cleanup := func() error {
return errors.Join(
closeLobbyServiceRoutes(),
closeUserServiceRoutes(),
closeRedisClient(),
)
@@ -216,7 +232,7 @@ func newAuthenticatedGRPCDependencies(ctx context.Context, cfg config.Config, lo
return grpcapi.ServerDependencies{
Service: grpcapi.NewFanOutPushStreamService(pushHub, responseSigner, nil, logger),
Router: downstream.NewStaticRouter(userRoutes),
Router: downstream.NewStaticRouter(allRoutes),
ResponseSigner: responseSigner,
SessionCache: sessionCache,
ReplayStore: replayStore,