start implementing gw serve mux support

This commit is contained in:
2025-03-24 12:43:53 -04:00
parent 3e319b24fd
commit 4e014d5ea0
11 changed files with 227 additions and 161 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"strings"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/rs/zerolog"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
@ -23,10 +24,15 @@ type appGRPCServer struct {
serverOpts []grpc.ServerOption
logger *zerolog.Logger
server *grpc.Server
gatewayMux *runtime.ServeMux
shutdownFunc func(context.Context) error
doneChan chan error
}
func (g *appGRPCServer) GetMux() *runtime.ServeMux {
return g.gatewayMux
}
// Returns a shutdown func, a channel indicating done / error,
// and an up-front error if server fails to start
func InitGRPCServer(ctx context.Context, opts *opts.GRPCOpts) (