Skip to content

Commit

Permalink
all: change import path to go4.org/grpc
Browse files Browse the repository at this point in the history
I want to continue the grpc-on-x/net/http2 experiment but also change
the code generator to remove some types. So, give it a distinct import
path so the clients wanting to use the experimental version can
compile in the same workspace as clients using the official
google.golang.org/grpc.
  • Loading branch information
bradfitz committed May 16, 2017
1 parent 4d918e3 commit 9f3812d
Show file tree
Hide file tree
Showing 67 changed files with 204 additions and 204 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go:
- 1.6.3
- 1.7

go_import_path: google.golang.org/grpc
go_import_path: go4.org/grpc

before_install:
- if [[ $TRAVIS_GO_VERSION != 1.5* ]]; then go get github.com/golang/lint/golint; fi
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and information about how to do so.

1. Check out the code:

$ go get google.golang.org/grpc
$ cd $GOPATH/src/google.golang.org/grpc
$ go get go4.org/grpc
$ cd $GOPATH/src/go4.org/grpc

1. Create a fork of the grpc-go repository.
1. Add your fork as a remote:
Expand Down
10 changes: 5 additions & 5 deletions Documentation/grpc-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ And concept of [metadata](http://www.grpc.io/docs/guides/concepts.html#metadata)

## Constructing metadata

A metadata can be created using package [metadata](https://godoc.org/google.golang.org/grpc/metadata).
A metadata can be created using package [metadata](https://godoc.org/go4.org/grpc/metadata).
The type MD is actually a map from string to a list of strings:

```go
Expand Down Expand Up @@ -102,7 +102,7 @@ Metadata that a client can receive includes header and trailer.

#### Unary call

Header and trailer sent along with a unary call can be retrieved using function [Header](https://godoc.org/google.golang.org/grpc#Header) and [Trailer](https://godoc.org/google.golang.org/grpc#Trailer) in [CallOption](https://godoc.org/google.golang.org/grpc#CallOption):
Header and trailer sent along with a unary call can be retrieved using function [Header](https://godoc.org/go4.org/grpc#Header) and [Trailer](https://godoc.org/google.golang.org/grpc#Trailer) in [CallOption](https://godoc.org/google.golang.org/grpc#CallOption):

```go
var header, trailer metadata.MD // variable to store header and trailer
Expand All @@ -124,7 +124,7 @@ For streaming calls including:
- Client streaming RPC
- Bidirectional streaming RPC

Header and trailer can be retrieved from the returned stream using function `Header` and `Trailer` in interface [ClientStream](https://godoc.org/google.golang.org/grpc#ClientStream):
Header and trailer can be retrieved from the returned stream using function `Header` and `Trailer` in interface [ClientStream](https://godoc.org/go4.org/grpc#ClientStream):

```go
stream, err := client.SomeStreamingRPC(ctx)
Expand Down Expand Up @@ -170,7 +170,7 @@ func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) erro

#### Unary call

To send header and trailer to client in unary call, the server can call [SendHeader](https://godoc.org/google.golang.org/grpc#SendHeader) and [SetTrailer](https://godoc.org/google.golang.org/grpc#SetTrailer) functions in module [grpc](https://godoc.org/google.golang.org/grpc).
To send header and trailer to client in unary call, the server can call [SendHeader](https://godoc.org/go4.org/grpc#SendHeader) and [SetTrailer](https://godoc.org/google.golang.org/grpc#SetTrailer) functions in module [grpc](https://godoc.org/google.golang.org/grpc).
These two functions take a context as the first parameter.
It should be the RPC handler's context or one derived from it:

Expand All @@ -187,7 +187,7 @@ func (s *server) SomeRPC(ctx context.Context, in *pb.someRequest) (*pb.someRespo

#### Streaming call

For streaming calls, header and trailer can be sent using function `SendHeader` and `SetTrailer` in interface [ServerStream](https://godoc.org/google.golang.org/grpc#ServerStream):
For streaming calls, header and trailer can be sent using function `SendHeader` and `SetTrailer` in interface [ServerStream](https://godoc.org/go4.org/grpc#ServerStream):

```go
func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) error {
Expand Down
6 changes: 3 additions & 3 deletions Documentation/server-reflection-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ For example, to enable server reflection in `example/helloworld`, we need to mak
+++ b/examples/helloworld/greeter_server/main.go
@@ -40,6 +40,7 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"
pb "google.golang.org/grpc/examples/helloworld/helloworld"
+ "google.golang.org/grpc/reflection"
"go4.org/grpc"
pb "go4.org/grpc/examples/helloworld/helloworld"
+ "go4.org/grpc/reflection"
)

const (
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
all: test testrace

deps:
go get -d -v google.golang.org/grpc/...
go get -d -v go4.org/grpc/...

updatedeps:
go get -d -v -u -f google.golang.org/grpc/...
go get -d -v -u -f go4.org/grpc/...

testdeps:
go get -d -v -t google.golang.org/grpc/...
go get -d -v -t go4.org/grpc/...

updatetestdeps:
go get -d -v -t -u -f google.golang.org/grpc/...
go get -d -v -t -u -f go4.org/grpc/...

build: deps
go build google.golang.org/grpc/...
go build go4.org/grpc/...

proto:
@ if ! which protoc > /dev/null; then \
Expand All @@ -27,13 +27,13 @@ proto:
done

test: testdeps
go test -v -cpu 1,4 google.golang.org/grpc/...
go test -v -cpu 1,4 go4.org/grpc/...

testrace: testdeps
go test -v -race -cpu 1,4 google.golang.org/grpc/...
go test -v -race -cpu 1,4 go4.org/grpc/...

clean:
go clean -i google.golang.org/grpc/...
go clean -i go4.org/grpc/...

coverage: testdeps
./coverage.sh --coveralls
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Installation

For development convenience (but not user convenience), the Go package path for this
repositor is unchanged. You can not fetch it with `go get`. You just `git clone` it to
`$GOPATH/src/google.golang.org/grpc` manually.
`$GOPATH/src/go4.org/grpc` manually.

Prerequisites
-------------
Expand Down
6 changes: 3 additions & 3 deletions benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import (
"net"

"golang.org/x/net/context"
"google.golang.org/grpc"
testpb "google.golang.org/grpc/benchmark/grpc_testing"
"google.golang.org/grpc/grpclog"
"go4.org/grpc"
testpb "go4.org/grpc/benchmark/grpc_testing"
"go4.org/grpc/grpclog"
)

func newPayload(t testpb.PayloadType, size int) *testpb.Payload {
Expand Down
8 changes: 4 additions & 4 deletions benchmark/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"time"

"golang.org/x/net/context"
"google.golang.org/grpc"
testpb "google.golang.org/grpc/benchmark/grpc_testing"
"google.golang.org/grpc/benchmark/stats"
"google.golang.org/grpc/grpclog"
"go4.org/grpc"
testpb "go4.org/grpc/benchmark/grpc_testing"
"go4.org/grpc/benchmark/stats"
"go4.org/grpc/grpclog"
)

func runUnary(b *testing.B, maxConcurrentCalls int) {
Expand Down
10 changes: 5 additions & 5 deletions benchmark/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"time"

"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/benchmark"
testpb "google.golang.org/grpc/benchmark/grpc_testing"
"google.golang.org/grpc/benchmark/stats"
"google.golang.org/grpc/grpclog"
"go4.org/grpc"
"go4.org/grpc/benchmark"
testpb "go4.org/grpc/benchmark/grpc_testing"
"go4.org/grpc/benchmark/stats"
"go4.org/grpc/grpclog"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion benchmark/grpc_testing/services.pb.go

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

4 changes: 2 additions & 2 deletions benchmark/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
_ "net/http/pprof"
"time"

"google.golang.org/grpc/benchmark"
"google.golang.org/grpc/grpclog"
"go4.org/grpc/benchmark"
"go4.org/grpc/grpclog"
)

var (
Expand Down
14 changes: 7 additions & 7 deletions benchmark/worker/benchmark_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ import (
"time"

"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/benchmark"
testpb "google.golang.org/grpc/benchmark/grpc_testing"
"google.golang.org/grpc/benchmark/stats"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
"go4.org/grpc"
"go4.org/grpc/benchmark"
testpb "go4.org/grpc/benchmark/grpc_testing"
"go4.org/grpc/benchmark/stats"
"go4.org/grpc/codes"
"go4.org/grpc/credentials"
"go4.org/grpc/grpclog"
)

var (
Expand Down
14 changes: 7 additions & 7 deletions benchmark/worker/benchmark_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ import (
"sync"
"time"

"google.golang.org/grpc"
"google.golang.org/grpc/benchmark"
testpb "google.golang.org/grpc/benchmark/grpc_testing"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
"go4.org/grpc"
"go4.org/grpc/benchmark"
testpb "go4.org/grpc/benchmark/grpc_testing"
"go4.org/grpc/codes"
"go4.org/grpc/credentials"
"go4.org/grpc/grpclog"
)

var (
// File path related to google.golang.org/grpc.
// File path related to go4.org/grpc.
certFile = "benchmark/server/testdata/server1.pem"
keyFile = "benchmark/server/testdata/server1.key"
)
Expand Down
8 changes: 4 additions & 4 deletions benchmark/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ import (
"time"

"golang.org/x/net/context"
"google.golang.org/grpc"
testpb "google.golang.org/grpc/benchmark/grpc_testing"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"go4.org/grpc"
testpb "go4.org/grpc/benchmark/grpc_testing"
"go4.org/grpc/codes"
"go4.org/grpc/grpclog"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions benchmark/worker/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ import (
)

// abs returns the absolute path the given relative file or directory path,
// relative to the google.golang.org/grpc directory in the user's GOPATH.
// relative to the go4.org/grpc directory in the user's GOPATH.
// If rel is already absolute, it is returned unmodified.
func abs(rel string) string {
if filepath.IsAbs(rel) {
return rel
}
v, err := goPackagePath("google.golang.org/grpc")
v, err := goPackagePath("go4.org/grpc")
if err != nil {
log.Fatalf("Error finding google.golang.org/grpc/testdata directory: %v", err)
log.Fatalf("Error finding go4.org/grpc/testdata directory: %v", err)
}
return filepath.Join(v, rel)
}
Expand Down
6 changes: 3 additions & 3 deletions call.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import (

"golang.org/x/net/context"
"golang.org/x/net/trace"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/stats"
"go4.org/grpc/codes"
"go4.org/grpc/metadata"
"go4.org/grpc/stats"
)

// Invoke sends a non-streaming RPC request on the wire and returns
Expand Down
4 changes: 2 additions & 2 deletions call_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import (
"time"

"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/transport"
"go4.org/grpc/codes"
"go4.org/grpc/transport"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions clientconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import (
"fmt"
"net/http"

"google.golang.org/grpc/credentials"
"google.golang.org/grpc/stats"
"go4.org/grpc/credentials"
"go4.org/grpc/stats"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion clientconn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (

"golang.org/x/net/context"

"google.golang.org/grpc/credentials"
"go4.org/grpc/credentials"
)

const tlsDir = "testdata/"
Expand Down
2 changes: 1 addition & 1 deletion codes/codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

// Package codes defines the canonical error codes used by gRPC. It is
// consistent across various languages.
package codes // import "google.golang.org/grpc/codes"
package codes // import "go4.org/grpc/codes"

// A Code is an unsigned 32-bit error code as defined in the gRPC spec.
type Code uint32
Expand Down
4 changes: 2 additions & 2 deletions coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ set -e
workdir=.cover
profile="$workdir/cover.out"
mode=set
end2endtest="google.golang.org/grpc/test"
end2endtest="go4.org/grpc/test"

generate_cover_data() {
rm -rf "$workdir"
mkdir "$workdir"

for pkg in "$@"; do
if [ $pkg == "google.golang.org/grpc" -o $pkg == "google.golang.org/grpc/transport" -o $pkg == "google.golang.org/grpc/metadata" -o $pkg == "google.golang.org/grpc/credentials" ]
if [ $pkg == "go4.org/grpc" -o $pkg == "google.golang.org/grpc/transport" -o $pkg == "google.golang.org/grpc/metadata" -o $pkg == "google.golang.org/grpc/credentials" ]
then
f="$workdir/$(echo $pkg | tr / -)"
go test -covermode="$mode" -coverprofile="$f.cover" "$pkg"
Expand Down
2 changes: 1 addition & 1 deletion credentials/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// which encapsulate all the state needed by a client to authenticate with a
// server and make various assertions, e.g., about the client's identity, role,
// or whether it is authorized to make a particular call.
package credentials // import "google.golang.org/grpc/credentials"
package credentials // import "go4.org/grpc/credentials"

import (
"crypto/tls"
Expand Down
2 changes: 1 addition & 1 deletion credentials/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"golang.org/x/oauth2/jwt"
"google.golang.org/grpc/credentials"
"go4.org/grpc/credentials"
)

// TokenSource supplies PerRPCCredentials from an oauth2.TokenSource.
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Package grpc implements an RPC system called gRPC.
See www.grpc.io for more information about gRPC.
*/
package grpc // import "google.golang.org/grpc"
package grpc // import "go4.org/grpc"
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ INSTALL
-------

```
$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client
$ go get -u google.golang.org/grpc/examples/helloworld/greeter_server
$ go get -u go4.org/grpc/examples/helloworld/greeter_client
$ go get -u go4.org/grpc/examples/helloworld/greeter_server
```

TRY IT!
Expand Down
Loading

0 comments on commit 9f3812d

Please sign in to comment.