unified gateway interface

This commit is contained in:
Stephan D
2025-12-31 17:47:32 +01:00
parent 19b7b69bd8
commit 97ba7500dc
104 changed files with 8228 additions and 1742 deletions

View File

@@ -36,6 +36,7 @@ type Imp struct {
app *grpcapp.App[storage.Repository]
rpcClients *rpcclient.Clients
service *gatewayservice.Service
}
type config struct {
@@ -100,6 +101,10 @@ func (i *Imp) Shutdown() {
timeout = i.config.Runtime.ShutdownTimeout()
}
if i.service != nil {
i.service.Shutdown()
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
@@ -151,7 +156,9 @@ func (i *Imp) Start() error {
gatewayservice.WithDriverRegistry(driverRegistry),
gatewayservice.WithSettings(cfg.Settings),
}
return gatewayservice.NewService(logger, repo, producer, opts...), nil
svc := gatewayservice.NewService(logger, repo, producer, opts...)
i.service = svc
return svc, nil
}
app, err := grpcapp.NewApp(i.logger, "chain", cfg.Config, i.debug, repoFactory, serviceFactory)