some fixes in structure and imports
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user