Compare commits

..

No commits in common. "b44b6a331c7bce743a242b04200be64735d1bb3b" and "89f016ed9d985a86316f9b3907bbaaf558b70bfb" have entirely different histories.

3 changed files with 2 additions and 12 deletions

View File

@ -18,7 +18,7 @@ func (a *appGRPCServer) registerServiceGatewayHandlers(ctx context.Context, serv
if len(service.GwRegistrationFuncs) < 1 {
return
} else if a.gatewayMux == nil {
a.gatewayMux = runtime.NewServeMux(a.opts.GRPCGatewayOpts...)
a.gatewayMux = runtime.NewServeMux()
}
ctx, span := a.tracer.Start(ctx, "appgrpc.init.prepare.service.gwHandlers", trace.WithAttributes(
@ -50,7 +50,6 @@ func (a *appGRPCServer) GetClientConn(ctx context.Context) *grpc.ClientConn {
if err != nil {
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
panic(err)
}
return clientConn

View File

@ -19,8 +19,7 @@ type AppGRPC struct {
UnaryInterceptors []grpc.UnaryServerInterceptor
StreamInterceptors []grpc.StreamServerInterceptor
GRPCOpts []grpc.ServerOption
GRPCDialOpts []grpc.DialOption // Map ServerOptions to DialOpts for GRPC Gateway support
GRPCGatewayOpts []runtime.ServeMuxOption // Configure grpc-gateway ServeMux
GRPCDialOpts []grpc.DialOption // Map ServerOptions to DialOpts for GRPC Gateway support
GRPCDone <-chan error
gatewayMux *runtime.ServeMux
}

View File

@ -7,7 +7,6 @@ import (
"net"
"net/http"
"os"
"strings"
"time"
"github.com/prometheus/client_golang/prometheus/promhttp"
@ -61,13 +60,6 @@ func prepHTTPServer(opts *opts.AppHTTP) *http.Server {
// Inject extra handlers if given
// Used for grpc-gateway runtime.ServeMux handlers
for _, h := range opts.Handlers {
// prefix must end in / to route sub-paths
if !strings.HasSuffix(h.Prefix, "/") {
h.Prefix = h.Prefix + "/"
}
// if enabled, the path prefix is stripped before
// requests are sent to the handler
if h.StripPrefix {
h.Handler = http.StripPrefix(h.Prefix, h.Handler)
}