protoc-gen-onexmesh

command
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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