Skip to content

Commit

Permalink
Rename paths grpc-ecosystem --> catper
Browse files Browse the repository at this point in the history
  • Loading branch information
catper committed Mar 12, 2020
1 parent 1af2286 commit 7b78ef4
Show file tree
Hide file tree
Showing 149 changed files with 1,443 additions and 1,441 deletions.
4 changes: 2 additions & 2 deletions .circleci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Contained within is the CI test setup for the Gateway. It runs on Circle CI.
Great, it should be as simple as thus (run from the root of the directory):

```bash
$ docker run -v $(pwd):/go/src/github.com/grpc-ecosystem/grpc-gateway --rm jfbrandhorst/grpc-gateway-build-env:1.14 \
/bin/bash -c 'cd /go/src/github.com/grpc-ecosystem/grpc-gateway && \
$ docker run -v $(pwd):/go/src/github.com/catper/grpc-gateway --rm jfbrandhorst/grpc-gateway-build-env:1.14 \
/bin/bash -c 'cd /go/src/github.com/catper/grpc-gateway && \
make realclean && \
make examples'
```
Expand Down
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildifier(
# gazelle:exclude third_party
# gazelle:exclude vendor
# gazelle:exclude _output
# gazelle:prefix github.com/grpc-ecosystem/grpc-gateway
# gazelle:prefix github.com/catper/grpc-gateway

gazelle(name = "gazelle")

Expand Down
1,932 changes: 966 additions & 966 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Thank you for your contribution to grpc-gateway.
Here's the recommended process of contribution.

1. `go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway`
2. `cd $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway`
1. `go get github.com/catper/grpc-gateway/protoc-gen-grpc-gateway`
2. `cd $GOPATH/src/github.com/catper/grpc-gateway`
3. hack, hack, hack...
4. Make sure that your change follows best practices in Go
- [Effective Go](https://golang.org/doc/effective_go.html)
Expand Down
8 changes: 4 additions & 4 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# The gRPC-Gateway project is maintained by volunteers in their spare time. Please follow these troubleshooting steps before submitting an issue.

- [ ] Check if your issue has already been reported (https://github.com/grpc-ecosystem/grpc-gateway/issues).
- [ ] Check if your issue has already been reported (https://github.com/catper/grpc-gateway/issues).
- [ ] Update your protoc to the [latest version](https://github.com/google/protobuf/releases).
- [ ] Update your copy of the `grpc-gateway` library to the latest version from github:
```sh
go get -u github.com/grpc-ecosystem/grpc-gateway
go get -u github.com/catper/grpc-gateway
```
- [ ] Delete the `protoc-gen-grpc-gateway` and `protoc-gen-swagger` binary from your `PATH`,
and reinstall the latest versions:
```sh
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/catper/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/catper/grpc-gateway/protoc-gen-swagger
```

## I still have a problem!
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# grpc-gateway itself.

GO_PLUGIN=bin/protoc-gen-go
GO_PROTOBUF_REPO=github.com/golang/protobuf
GO_PROTOBUF_REPO=github.com/catper/protobuf
GO_PLUGIN_PKG=$(GO_PROTOBUF_REPO)/protoc-gen-go
GO_PTYPES_ANY_PKG=$(GO_PROTOBUF_REPO)/ptypes/any
SWAGGER_PLUGIN=bin/protoc-gen-swagger
Expand Down Expand Up @@ -50,7 +50,7 @@ RUNTIME_GO=$(RUNTIME_PROTO:.proto=.pb.go)
OPENAPIV2_PROTO=protoc-gen-swagger/options/openapiv2.proto protoc-gen-swagger/options/annotations.proto
OPENAPIV2_GO=$(OPENAPIV2_PROTO:.proto=.pb.go)

PKGMAP=Mgoogle/protobuf/field_mask.proto=google.golang.org/genproto/protobuf/field_mask,Mgoogle/protobuf/descriptor.proto=$(GO_PLUGIN_PKG)/descriptor,Mexamples/internal/proto/sub/message.proto=github.com/grpc-ecosystem/grpc-gateway/examples/internal/proto/sub
PKGMAP=Mgoogle/protobuf/field_mask.proto=google.golang.org/genproto/protobuf/field_mask,Mgoogle/protobuf/descriptor.proto=$(GO_PLUGIN_PKG)/descriptor,Mexamples/internal/proto/sub/message.proto=github.com/catper/grpc-gateway/examples/internal/proto/sub
ADDITIONAL_GW_FLAGS=
ifneq "$(GATEWAY_PLUGIN_FLAGS)" ""
ADDITIONAL_GW_FLAGS=,$(GATEWAY_PLUGIN_FLAGS)
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# grpc-gateway

[![release](https://img.shields.io/github/release/grpc-ecosystem/grpc-gateway.svg?style=flat-square)](https://github.com/grpc-ecosystem/grpc-gateway/releases) [![CircleCI](https://img.shields.io/circleci/project/github/grpc-ecosystem/grpc-gateway/master.svg?style=flat-square)](https://circleci.com/gh/grpc-ecosystem/grpc-gateway) [![fuzzit](https://app.fuzzit.dev/badge?org_id=grpc-gateway)](https://app.fuzzit.dev/orgs/grpc-gateway/dashboard) [![coverage](https://img.shields.io/codecov/c/github/grpc-ecosystem/grpc-gateway/master.svg?style=flat-square)](https://codecov.io/gh/grpc-ecosystem/grpc-gateway) [![license](https://img.shields.io/github/license/grpc-ecosystem/grpc-gateway.svg?style=flat-square)](LICENSE.txt)
[![release](https://img.shields.io/github/release/grpc-ecosystem/grpc-gateway.svg?style=flat-square)](https://github.com/catper/grpc-gateway/releases) [![CircleCI](https://img.shields.io/circleci/project/github/grpc-ecosystem/grpc-gateway/master.svg?style=flat-square)](https://circleci.com/gh/grpc-ecosystem/grpc-gateway) [![fuzzit](https://app.fuzzit.dev/badge?org_id=grpc-gateway)](https://app.fuzzit.dev/orgs/grpc-gateway/dashboard) [![coverage](https://img.shields.io/codecov/c/github/grpc-ecosystem/grpc-gateway/master.svg?style=flat-square)](https://codecov.io/gh/grpc-ecosystem/grpc-gateway) [![license](https://img.shields.io/github/license/grpc-ecosystem/grpc-gateway.svg?style=flat-square)](LICENSE.txt)

The grpc-gateway is a plugin of the Google protocol buffers compiler
[protoc](https://github.com/protocolbuffers/protobuf).
Expand Down Expand Up @@ -48,19 +48,19 @@ to track the versions of the following executable packages:
package tools

import (
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway"
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger"
_ "github.com/golang/protobuf/protoc-gen-go"
_ "github.com/catper/grpc-gateway/protoc-gen-grpc-gateway"
_ "github.com/catper/grpc-gateway/protoc-gen-swagger"
_ "github.com/catper/protobuf/protoc-gen-go"
)
```

Run `go mod tidy` to resolve the versions. Install by running

```sh
$ go install \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
github.com/golang/protobuf/protoc-gen-go
github.com/catper/grpc-gateway/protoc-gen-grpc-gateway \
github.com/catper/grpc-gateway/protoc-gen-swagger \
github.com/catper/protobuf/protoc-gen-go
```

This will place three binaries in your `$GOBIN`;
Expand Down Expand Up @@ -129,7 +129,7 @@ annotation to your .proto file
```sh
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I$GOPATH/src/github.com/catper/grpc-gateway/third_party/googleapis \
--go_out=plugins=grpc:. \
path/to/your_service.proto
```
Expand All @@ -144,13 +144,13 @@ annotation to your .proto file
```sh
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I$GOPATH/src/github.com/catper/grpc-gateway/third_party/googleapis \
--ruby_out=. \
path/to/your_service.proto

protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I$GOPATH/src/github.com/catper/grpc-gateway/third_party/googleapis \
--plugin=protoc-gen-grpc=grpc_ruby_plugin \
--grpc-ruby_out=. \
path/to/your_service.proto
Expand All @@ -163,7 +163,7 @@ annotation to your .proto file
```sh
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I$GOPATH/src/github.com/catper/grpc-gateway/third_party/googleapis \
--grpc-gateway_out=logtostderr=true:. \
path/to/your_service.proto
```
Expand All @@ -181,7 +181,7 @@ annotation to your .proto file
"net/http"

"github.com/golang/glog"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/catper/grpc-gateway/runtime"
"google.golang.org/grpc"

gw "path/to/your_service_package" // Update
Expand Down Expand Up @@ -226,7 +226,7 @@ annotation to your .proto file
```sh
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I$GOPATH/src/github.com/catper/grpc-gateway/third_party/googleapis \
--swagger_out=logtostderr=true:. \
path/to/your_service.proto
```
Expand All @@ -244,7 +244,7 @@ example:

`protoc-gen-grpc-gateway` supports custom mapping from Protobuf `import` to
Golang import paths. They are compatible to
[the parameters with same names in `protoc-gen-go`](https://github.com/golang/protobuf#parameters)
[the parameters with same names in `protoc-gen-go`](https://github.com/catper/protobuf#parameters)
(except `source_relative`).

In addition we also support the `request_context` parameter in order to use the
Expand Down Expand Up @@ -308,7 +308,7 @@ But patch is welcome.

# Mapping gRPC to HTTP

* [How gRPC error codes map to HTTP status codes in the response](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/runtime/errors.go#L15).
* [How gRPC error codes map to HTTP status codes in the response](https://github.com/catper/grpc-gateway/blob/master/runtime/errors.go#L15).
* HTTP request source IP is added as `X-Forwarded-For` gRPC request header.
* HTTP request host is added as `X-Forwarded-Host` gRPC request header.
* HTTP `Authorization` header is added as `authorization` gRPC request header.
Expand All @@ -319,12 +319,12 @@ header.
* HTTP headers that start with 'Grpc-Metadata-' are mapped to gRPC metadata
(prefixed with `grpcgateway-`).
* While configurable, the default {un,}marshaling uses
[jsonpb](https://godoc.org/github.com/golang/protobuf/jsonpb) with
[jsonpb](https://godoc.org/github.com/catper/protobuf/jsonpb) with
`OrigName: true`.

# Contribution
See [CONTRIBUTING.md](http://github.com/grpc-ecosystem/grpc-gateway/blob/master/CONTRIBUTING.md).
See [CONTRIBUTING.md](http://github.com/catper/grpc-gateway/blob/master/CONTRIBUTING.md).

# License
grpc-gateway is licensed under the BSD 3-Clause License.
See [LICENSE.txt](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt) for more details.
See [LICENSE.txt](https://github.com/catper/grpc-gateway/blob/master/LICENSE.txt) for more details.
24 changes: 12 additions & 12 deletions docs/_docs/customizingyourgateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ order: 101

You might want to serialize request/response messages in MessagePack instead of JSON, for example.

1. Write a custom implementation of [`Marshaler`](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#Marshaler)
2. Register your marshaler with [`WithMarshalerOption`](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#WithMarshalerOption)
1. Write a custom implementation of [`Marshaler`](http://godoc.org/github.com/catper/grpc-gateway/runtime#Marshaler)
2. Register your marshaler with [`WithMarshalerOption`](http://godoc.org/github.com/catper/grpc-gateway/runtime#WithMarshalerOption)
e.g.
```go
var m your.MsgPackMarshaler
mux := runtime.NewServeMux(runtime.WithMarshalerOption("application/x-msgpack", m))
```

You can see [the default implementation for JSON](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/runtime/marshal_jsonpb.go) for reference.
You can see [the default implementation for JSON](https://github.com/catper/grpc-gateway/blob/master/runtime/marshal_jsonpb.go) for reference.

### Using camelCase for JSON

Expand Down Expand Up @@ -78,10 +78,10 @@ Note that this will conflict with any methods having input messages with fields
also, this example code does not remove the query parameter `pretty` from further processing.
## Mapping from HTTP request headers to gRPC client metadata
You might not like [the default mapping rule](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#DefaultHeaderMatcher) and might want to pass through all the HTTP headers, for example.
You might not like [the default mapping rule](http://godoc.org/github.com/catper/grpc-gateway/runtime#DefaultHeaderMatcher) and might want to pass through all the HTTP headers, for example.
1. Write a [`HeaderMatcherFunc`](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#HeaderMatcherFunc).
2. Register the function with [`WithIncomingHeaderMatcher`](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#WithIncomingHeaderMatcher)
1. Write a [`HeaderMatcherFunc`](http://godoc.org/github.com/catper/grpc-gateway/runtime#HeaderMatcherFunc).
2. Register the function with [`WithIncomingHeaderMatcher`](http://godoc.org/github.com/catper/grpc-gateway/runtime#WithIncomingHeaderMatcher)
e.g.
```go
Expand All @@ -99,7 +99,7 @@ You might not like [the default mapping rule](http://godoc.org/github.com/grpc-e
mux := runtime.NewServeMux(runtime.WithIncomingHeaderMatcher(CustomMatcher))
```
To keep the [the default mapping rule](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#DefaultHeaderMatcher) alongside with your own rules write:
To keep the [the default mapping rule](http://godoc.org/github.com/catper/grpc-gateway/runtime#DefaultHeaderMatcher) alongside with your own rules write:
```go
func CustomMatcher(key string) (string, bool) {
Expand Down Expand Up @@ -133,7 +133,7 @@ if md, ok := metadata.FromIncomingContext(ctx); ok {
```
## Mapping from gRPC server metadata to HTTP response headers
ditto. Use [`WithOutgoingHeaderMatcher`](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#WithOutgoingHeaderMatcher).
ditto. Use [`WithOutgoingHeaderMatcher`](http://godoc.org/github.com/catper/grpc-gateway/runtime#WithOutgoingHeaderMatcher).
See [gRPC metadata docs](https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md)
for more info on sending / receiving gRPC metadata.
Expand Down Expand Up @@ -166,7 +166,7 @@ Or you might want to mutate the response messages to be returned.
return nil
}
```
2. Register the filter with [`WithForwardResponseOption`](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#WithForwardResponseOption)
2. Register the filter with [`WithForwardResponseOption`](http://godoc.org/github.com/catper/grpc-gateway/runtime#WithForwardResponseOption)
e.g.
```go
Expand Down Expand Up @@ -323,7 +323,7 @@ the source error has no gRPC attributes).
## Replace a response forwarder per method
You might want to keep the behavior of the current marshaler but change only a message forwarding of a certain API method.

1. write a custom forwarder which is compatible to [`ForwardResponseMessage`](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#ForwardResponseMessage) or [`ForwardResponseStream`](http://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#ForwardResponseStream).
1. write a custom forwarder which is compatible to [`ForwardResponseMessage`](http://godoc.org/github.com/catper/grpc-gateway/runtime#ForwardResponseMessage) or [`ForwardResponseStream`](http://godoc.org/github.com/catper/grpc-gateway/runtime#ForwardResponseStream).
2. replace the default forwarder of the method with your one.

e.g. add `forwarder_overwrite.go` into the go package of the generated code,
Expand All @@ -333,8 +333,8 @@ You might want to keep the behavior of the current marshaler but change only a m
import (
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/golang/protobuf/proto"
"github.com/catper/grpc-gateway/runtime"
"github.com/catper/protobuf/proto"
"golang.org/x/net/context"
)
Expand Down
24 changes: 12 additions & 12 deletions docs/_docs/cygwin.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,36 +33,36 @@ From an elevated cmd.exe prompt set the GOPATH variable in windows and add the `

Then `go get -u -v` the following packages:

go get -u -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u -v github.com/golang/protobuf/protoc-gen-go
go get -u -v github.com/catper/grpc-gateway/protoc-gen-grpc-gateway
go get -u -v github.com/catper/grpc-gateway/protoc-gen-swagger
go get -u -v github.com/catper/protobuf/protoc-gen-go

This will probably fail with similar output.

github.com/grpc-ecosystem/grpc-gateway (download)
# cd .; git clone https://github.com/grpc-ecosystem/grpc-gateway C:\path\to\your\cygwin\home\user\go\src\github.com\grpc-ecosystem\grpc-gateway
github.com/catper/grpc-gateway (download)
# cd .; git clone https://github.com/catper/grpc-gateway C:\path\to\your\cygwin\home\user\go\src\github.com\grpc-ecosystem\grpc-gateway
Cloning into 'C:\path\to\your\cygwin\home\user\go\src\github.com\grpc-ecosystem\grpc-gateway'...
fatal: Invalid path '/home/user/go/C:\path\to\your\cygwin\home\user\go\src\github.com\grpc-ecosystem\grpc-gateway': No such file or directory
package github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway: exit status 128
package github.com/catper/grpc-gateway/protoc-gen-grpc-gateway: exit status 128

To fix this you need to run the `go get -u -v` commands and look for all lines starting with `# cd .; `.
Copy and paste these lines into your shell and change the clone destination directories.

git clone https://github.com/grpc-ecosystem/grpc-gateway $(cygpath -u $GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway
git clone https://github.com/catper/grpc-gateway $(cygpath -u $GOPATH)/src/github.com/catper/grpc-gateway
git clone https://github.com/golang/glog $(cygpath -u $GOPATH)/src/github.com/golang/glog
git clone https://github.com/golang/protobuf $(cygpath -u $GOPATH)/src/github.com/golang/protobuf
git clone https://github.com/catper/protobuf $(cygpath -u $GOPATH)/src/github.com/catper/protobuf
git clone https://github.com/google/go-genproto $(cygpath -u $GOPATH)/src/google.golang.org/genproto

Once the clone operations are finished the `go get -u -v` commands shouldn't give you an error anymore.

## Usage
Follow the [instuctions](https://github.com/grpc-ecosystem/grpc-gateway#usage) in the [README](https://github.com/grpc-ecosystem/grpc-gateway).
Follow the [instuctions](https://github.com/catper/grpc-gateway#usage) in the [README](https://github.com/catper/grpc-gateway).

Adjust steps 3, 5 and 7 like this. protoc expects native windows paths.

protoc -I. -I$(cygpath -w /usr/local/include) -I${GOPATH}/src -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:. ./path/to/your_service.proto
protoc -I. -I$(cygpath -w /usr/local/include) -I${GOPATH}/src -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --grpc-gateway_out=logtostderr=true:. ./path/to/your_service.proto
protoc -I. -I$(cygpath -w /usr/local/include) -I${GOPATH}/src -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --swagger_out=logtostderr=true:. ./path/to/your_service.proto
protoc -I. -I$(cygpath -w /usr/local/include) -I${GOPATH}/src -I${GOPATH}/src/github.com/catper/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:. ./path/to/your_service.proto
protoc -I. -I$(cygpath -w /usr/local/include) -I${GOPATH}/src -I${GOPATH}/src/github.com/catper/grpc-gateway/third_party/googleapis --grpc-gateway_out=logtostderr=true:. ./path/to/your_service.proto
protoc -I. -I$(cygpath -w /usr/local/include) -I${GOPATH}/src -I${GOPATH}/src/github.com/catper/grpc-gateway/third_party/googleapis --swagger_out=logtostderr=true:. ./path/to/your_service.proto

Then `cd` into the directory where your entry-point `main.go` file is located and run

Expand Down
Loading

0 comments on commit 7b78ef4

Please sign in to comment.