implement grpc gateway and addl handler support
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user