Documentation
¶
Overview ¶
Command protoc-gen-onexmesh is a protoc plugin that generates HTTP route descriptors for a service whose methods carry the onexmesh.v1.http annotation (see pkg/proto/onexmesh/v1/http.proto).
For an annotated method:
service Greeter {
rpc SayHello(HelloRequest) returns (HelloReply) {
option (onexmesh.v1.http) = { get: "/helloworld/{name}" };
}
}
it emits a *_http.pb.go with a single factory:
func NewGreeterService(srv GreeterServer) server.Service
The returned server.Service declares proto-first Methods whose request/response types are enforced to be protobuf at compile time, plus the generated gRPC RegisterXxxServer bridge. A single srv.SayHello function therefore serves both protocols; the HTTP binding (path/query/body) is performed by the shared codec.BindHTTP runtime rather than per-method hand-written handlers.
Click to show internal directories.
Click to hide internal directories.