protoc-gen-onexmesh

command
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL