New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support creating gateway from runtime-compiled protobuf files #3348
Comments
Yeah I don't think this is possible with the grpc-gateway as it exists today. If you want to do this, I'd probably recommend looking to write your own translation layer that can be built dynamically, or look at other tools that do a similar thing to the grpc-gateway. This is squarely outside the scope of this project, at least. |
By "out of scope" do you mean that is not going to be planned, or that even if someone made a PR of sufficient quality it wouldn't get merged? |
I meant the former, though I think even a contribution would have to be a whole new package that's almost as good as building it from scratch. If you're interested in contributing this, I will of course happily guide you along. |
Much appreciated. I will have to dig into the internals to determine how amenable the code base is to this addition. If the situation is as you describe, I am assuming it will be quite a bit of work. |
@andremarianiello checkout https://github.com/bufbuild/larking for dynamic protobuf support. |
馃殌 Feature
I have a program that compiles protobuf files at runtime, and dynamically registers handlers for the services found in the protos, and uses dynamicpb for the messages. I would like to achieve something similar with a grpc-gateway handler. I want to compile protobuf files on startup, and turn the found gateway options into a grpc-gateway handler/muxer that translates incoming requests to protobufs, passes them to my grpc server, and translates the responses back. All the examples I have seen involve generating code before compiling, but that will not work for my use case.
For reference, I am compiling protos with https://github.com/bufbuild/protocompile and creating my grpc server using https://pkg.go.dev/google.golang.org/grpc#UnknownServiceHandler.
The text was updated successfully, but these errors were encountered: