Skip to content

Commit

Permalink
fix: remove jrpc doc generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja7ad committed Sep 24, 2024
1 parent abb2a35 commit 545b0ce
Show file tree
Hide file tree
Showing 6,674 changed files with 153 additions and 1,477,051 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion _example/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func main() {
url := "http://localhost:8081"
method := "POST"

payload := strings.NewReader(`{"jsonrpc":"2.0","id":"1111","method":"proto.echo_service.echo", "params":{"name":"javad"}}`)
payload := strings.NewReader(`{"jsonrpc":"2.0","id":"1111","method":"proto.echo_service.echo", "params":{"name":"javad", "type": "EchoType_BAR"}}`)

client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
Expand Down
3 changes: 2 additions & 1 deletion _example/proto/docs/json-rpc.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ <h3>Parameters</h3>
<pre>
<code>
{
"name": "str" // (string)
"name": "str", // (string)
"type": "FOO or BAR" // (string)
}
</code>
</pre>
Expand Down
3 changes: 2 additions & 1 deletion _example/proto/docs/json-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ proto.echoservice.
### Parameters
```json
{
"name": "str" // (string)
"name": "str", // (string)
"type": "FOO or BAR" // (string)
}
```

Expand Down
120 changes: 91 additions & 29 deletions _example/proto/echo.pb.go

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

5 changes: 5 additions & 0 deletions _example/proto/echo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ service EchoService {

message EchoRequest {
string name = 1;
EchoType type = 2;
}

message EchoResponse {
string message = 1;
}

enum EchoType {
FOO = 0;
BAR = 1;
}
17 changes: 10 additions & 7 deletions _example/proto/echo_grpc.pb.go

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

3 changes: 3 additions & 0 deletions _example/proto/gen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package proto

//go:generate protoc --proto_path=. --go_out=. --go_opt paths=source_relative --go-grpc_out=. --go-grpc_opt paths=source_relative --jrpc-gateway_out=. --jrpc-gateway_opt paths=source_relative echo.proto
2 changes: 1 addition & 1 deletion _example/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (s *Server) Stop() {

func (s *Server) Echo(ctx context.Context, req *proto.EchoRequest) (*proto.EchoResponse, error) {
return &proto.EchoResponse{
Message: fmt.Sprintf("echo %s!!!", req.Name),
Message: fmt.Sprintf("echo %s %v!!!", req.Name, req.Type),
}, nil
}

Expand Down
61 changes: 11 additions & 50 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,61 +1,22 @@
module github.com/pacviewer/jrpc-gateway

go 1.22.2
go 1.23.1

require (
github.com/Masterminds/semver v1.4.2 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/envoyproxy/protoc-gen-validate v1.0.4
github.com/gogo/protobuf v1.3.2 // indirect
github.com/huandu/xstrings v1.0.0 // indirect
github.com/imdario/mergo v0.3.4 // indirect
github.com/mwitkow/go-proto-validators v0.3.2
github.com/pseudomuto/protokit v0.2.0
github.com/stretchr/testify v1.8.4
github.com/creachadair/jrpc2 v1.2.1
github.com/golang/glog v1.2.2
github.com/stretchr/testify v1.9.0
google.golang.org/grpc v1.67.0
google.golang.org/protobuf v1.34.2
)

require (
github.com/creachadair/jrpc2 v1.2.0
github.com/golang/glog v1.2.0
github.com/golang/protobuf v1.5.4
google.golang.org/api v0.173.0
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237
google.golang.org/protobuf v1.34.1
)

require (
cloud.google.com/go/compute v1.25.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/creachadair/mds v0.13.4 // indirect
github.com/creachadair/mds v0.16.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
google.golang.org/grpc v1.64.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 545b0ce

Please sign in to comment.