some fixes in structure and imports

This commit is contained in:
Timur Kh.
2025-12-15 22:40:30 +03:00
parent fc8ddbea8a
commit 4e5199c69d
4 changed files with 64 additions and 132 deletions
-7
View File
@@ -9,7 +9,6 @@ import (
"time"
authPb "datarush/pkg/api/auth"
orderPb "datarush/pkg/api/order"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"google.golang.org/grpc"
@@ -30,12 +29,6 @@ func StartGateway(grpcPort, httpPort int, authGrpcAddr string) error {
gwmux := runtime.NewServeMux()
opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}
// Register order service
grpcServerAddr := fmt.Sprintf("localhost:%d", grpcPort)
if err := orderPb.RegisterOrderServiceHandlerFromEndpoint(ctx, gwmux, grpcServerAddr, opts); err != nil {
return fmt.Errorf("failed to register order service: %w", err)
}
// Register auth service
if err := authPb.RegisterAuthServiceHandlerFromEndpoint(ctx, gwmux, authGrpcAddr, opts); err != nil {
return fmt.Errorf("failed to register auth service: %w", err)