package opts import ( "context" "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "gitea.libretechconsulting.com/rmcguire/go-app/pkg/config" ) type GRPCOpts struct { *config.GRPCConfig *AppGRPC } type AppGRPC struct { Services []*GRPCService 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 { Name string // Descriptive name of service Type *grpc.ServiceDesc // Type (from protoc generated code) 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 }