add changeset support

This commit is contained in:
pascal
2025-11-17 12:13:04 +01:00
parent cc97cffff1
commit 90c45a6e24
2 changed files with 36 additions and 22 deletions
+8 -1
View File
@@ -11,6 +11,7 @@ import (
"time"
"github.com/google/uuid"
"github.com/gorilla/mux"
grpcMiddleware "github.com/grpc-ecosystem/go-grpc-middleware/v2"
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/realip"
log "github.com/sirupsen/logrus"
@@ -91,9 +92,15 @@ func (s *BaseServer) EventStore() activity.Store {
})
}
func (s *BaseServer) Router() *mux.Router {
return Create(s, func() *mux.Router {
return nbhttp.NewRouter(s.AuthManager(), s.Metrics(), s.AccountManager())
})
}
func (s *BaseServer) APIHandler() http.Handler {
return Create(s, func() http.Handler {
httpAPIHandler, err := nbhttp.NewAPIHandler(context.Background(), s.AccountManager(), s.NetworksManager(), s.ResourcesManager(), s.RoutesManager(), s.GroupsManager(), s.GeoLocationManager(), s.AuthManager(), s.Metrics(), s.IntegratedValidator(), s.ProxyController(), s.PermissionsManager(), s.PeersManager(), s.SettingsManager(), s.NetworkMapController())
httpAPIHandler, err := nbhttp.NewAPIHandler(context.Background(), s.AccountManager(), s.NetworksManager(), s.ResourcesManager(), s.RoutesManager(), s.GroupsManager(), s.GeoLocationManager(), s.Router(), s.Metrics(), s.IntegratedValidator(), s.ProxyController(), s.PermissionsManager(), s.PeersManager(), s.SettingsManager(), s.NetworkMapController())
if err != nil {
log.Fatalf("failed to create API handler: %v", err)
}