Skip to content

Commit

Permalink
feat(server/cmd/protoc-gen-go-orb): Add our own protoc builder for {d…
Browse files Browse the repository at this point in the history
…rpc,grpc,http,hertz}
  • Loading branch information
jochumdev committed Aug 12, 2024
1 parent 48bcc6a commit a429876
Show file tree
Hide file tree
Showing 41 changed files with 3,483 additions and 1,772 deletions.
6 changes: 2 additions & 4 deletions benchmarks/rps/handler/echo/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import (
"github.com/go-orb/plugins/benchmarks/rps/proto/echo"
)

var _ echo.EchoServer = (*Handler)(nil)
var _ echo.EchoHandler = (*Handler)(nil)

// Handler is a test handler.
type Handler struct {
echo.UnsafeEchoServer
}
type Handler struct{}

// Echo implements the echo method.
func (c *Handler) Echo(_ context.Context, req *echo.Req) (*echo.Resp, error) {
Expand Down
21 changes: 8 additions & 13 deletions benchmarks/rps/proto/echo/echo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions benchmarks/rps/proto/echo/echo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@ syntax = "proto3";

package echo;

import "google/api/annotations.proto";

option go_package = "./echo;echo";

service Echo {
rpc Echo(Req) returns (Resp) {
option (google.api.http) = {
post : "/echo.Echo/Echo"
body : "*"
};
}
rpc Echo(Req) returns (Resp);
}

message Req { bytes payload = 1; }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 32 additions & 28 deletions benchmarks/rps/proto/echo/echo_orb.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions benchmarks/rps/proto/gen.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Package proto ...
package proto

// Download Google proto HTTP annotation libs
//go:generate wget -q -O google/api/annotations.proto https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/annotations.proto
//go:generate wget -q -O google/api/http.proto https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/http.proto

// Generate proto files
//go:generate protoc -I . --go-grpc_out=paths=source_relative:. --go-micro-http_out=paths=source_relative:. --go_out=paths=source_relative:. --go-drpc_out=paths=source_relative:. ./echo/echo.proto
//go:generate protoc -I . --go-orb_out=paths=source_relative:. --go-orb_opt="supported_servers=drpc;grpc;http;hertz" ./echo/echo.proto
31 changes: 0 additions & 31 deletions benchmarks/rps/proto/google/api/annotations.proto

This file was deleted.

Loading

0 comments on commit a429876

Please sign in to comment.