implement grpc gateway and addl handler support

This commit is contained in:
2025-03-24 16:24:03 -04:00
parent 4e014d5ea0
commit 262f6a4232
12 changed files with 241 additions and 165 deletions

View File

@ -19,7 +19,9 @@ type AppGRPC struct {
UnaryInterceptors []grpc.UnaryServerInterceptor
StreamInterceptors []grpc.StreamServerInterceptor
GRPCOpts []grpc.ServerOption
GRPCDialOpts []grpc.DialOption // Map ServerOptions to DialOpts for GRPC Gateway support
GRPCDone <-chan error
gatewayMux *runtime.ServeMux
}
type GRPCService struct {
@ -28,3 +30,11 @@ type GRPCService struct {
Service any // Implementation of GRPCService.Type (ptr)
GwRegistrationFuncs []func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error // Gateway regustration handler funcs
}
func (a *AppGRPC) SetGatewayMux(mux *runtime.ServeMux) {
a.gatewayMux = mux
}
func (a *AppGRPC) GetGatewayMux() *runtime.ServeMux {
return a.gatewayMux
}