Skip to content

Commit 7bde276

Browse files
fix: init dubbogo/grpc
1 parent 878cea2 commit 7bde276

File tree

561 files changed

+4215
-2433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

561 files changed

+4215
-2433
lines changed

.github/workflows/testing.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ jobs:
101101
if: contains(matrix.type, 'tests')
102102
run: |
103103
go version
104-
go test ${{ matrix.testflags }} -cpu 1,4 -timeout 7m google.golang.org/grpc/...
105-
cd ${GITHUB_WORKSPACE}/security/advancedtls && go test ${{ matrix.testflags }} -timeout 2m google.golang.org/grpc/security/advancedtls/...
106-
cd ${GITHUB_WORKSPACE}/security/authorization && go test ${{ matrix.testflags }} -timeout 2m google.golang.org/grpc/security/authorization/...
104+
go test ${{ matrix.testflags }} -cpu 1,4 -timeout 7m github.com/dubbogo/grpc-go/...
105+
cd ${GITHUB_WORKSPACE}/security/advancedtls && go test ${{ matrix.testflags }} -timeout 2m github.com/dubbogo/grpc-go/security/advancedtls/...
106+
cd ${GITHUB_WORKSPACE}/security/authorization && go test ${{ matrix.testflags }} -timeout 2m github.com/dubbogo/grpc-go/security/authorization/...
107107
108108
109109
# Non-core gRPC tests (examples, interop, etc)

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/grpc-go.iml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ How to get your contributions merged smoothly and quickly.
2222

2323
- The grpc package should only depend on standard Go packages and a small number
2424
of exceptions. If your contribution introduces new dependencies which are NOT
25-
in the [list](https://godoc.org/google.golang.org/grpc?imports), you need a
25+
in the [list](https://godoc.org/github.com/dubbogo/grpc-go?imports), you need a
2626
discussion with gRPC-Go authors and consultants.
2727

2828
- For speculative changes, consider opening an issue and discussing it first. If

Documentation/benchmark.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ compression turned on, invoking `benchmain` in the following way may closely
1111
simulate your application:
1212

1313
```bash
14-
$ go run google.golang.org/grpc/benchmark/benchmain/main.go \
14+
$ go run github.com/dubbogo/grpc-go/benchmark/benchmain/main.go \
1515
-workloads=streaming \
1616
-reqSizeBytes=1024 \
1717
-respSizeBytes=1024 \
@@ -43,7 +43,7 @@ of payload sizes (first two columns) and the weight associated with that range
4343
Assume that `benchmain` is invoked like so:
4444

4545
```bash
46-
$ go run google.golang.org/grpc/benchmark/benchmain/main.go \
46+
$ go run github.com/dubbogo/grpc-go/benchmark/benchmain/main.go \
4747
-workloads=unary \
4848
-reqPayloadCurveFiles=/path/to/csv \
4949
-respPayloadCurveFiles=/path/to/csv
@@ -59,16 +59,16 @@ execute the benchmark with each combination independently. That is, the
5959
following command will execute four benchmarks:
6060

6161
```bash
62-
$ go run google.golang.org/grpc/benchmark/benchmain/main.go \
62+
$ go run github.com/dubbogo/grpc-go/benchmark/benchmain/main.go \
6363
-workloads=unary \
6464
-reqPayloadCurveFiles=/path/to/csv1,/path/to/csv2 \
6565
-respPayloadCurveFiles=/path/to/csv3,/path/to/csv4
6666
```
6767

68-
You may also combine `PayloadCurveFiles` with `SizeBytes` options. For example:
68+
You may also Combine `PayloadCurveFiles` with `SizeBytes` options. For example:
6969

7070
```
71-
$ go run google.golang.org/grpc/benchmark/benchmain/main.go \
71+
$ go run github.com/dubbogo/grpc-go/benchmark/benchmain/main.go \
7272
-workloads=unary \
7373
-reqPayloadCurveFiles=/path/to/csv \
7474
-respSizeBytes=1

Documentation/compression.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
The preferred method for configuring message compression on both clients and
44
servers is to use
5-
[`encoding.RegisterCompressor`](https://godoc.org/google.golang.org/grpc/encoding#RegisterCompressor)
5+
[`encoding.RegisterCompressor`](https://godoc.org/github.com/dubbogo/grpc-go/encoding#RegisterCompressor)
66
to register an implementation of a compression algorithm. See
77
`grpc/encoding/gzip/gzip.go` for an example of how to implement one.
88

99
Once a compressor has been registered on the client-side, RPCs may be sent using
1010
it via the
11-
[`UseCompressor`](https://godoc.org/google.golang.org/grpc#UseCompressor)
11+
[`UseCompressor`](https://godoc.org/github.com/dubbogo/grpc-go#UseCompressor)
1212
`CallOption`. Remember that `CallOption`s may be turned into defaults for all
1313
calls from a `ClientConn` by using the
14-
[`WithDefaultCallOptions`](https://godoc.org/google.golang.org/grpc#WithDefaultCallOptions)
14+
[`WithDefaultCallOptions`](https://godoc.org/github.com/dubbogo/grpc-go#WithDefaultCallOptions)
1515
`DialOption`. If `UseCompressor` is used and the corresponding compressor has
1616
not been installed, an `Internal` error will be returned to the application
1717
before the RPC is sent.

Documentation/concurrency.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ in the route guide example [here][route-guide-stream]. Similar to clients,
3232
multiple services can be registered to the same server.
3333

3434
[helloworld]: https://github.com/grpc/grpc-go/blob/master/examples/helloworld/greeter_client/main.go#L43
35-
[client-conn]: https://godoc.org/google.golang.org/grpc#ClientConn
36-
[stream]: https://godoc.org/google.golang.org/grpc#Stream
35+
[client-conn]: https://godoc.org/github.com/dubbogo/grpc-go#ClientConn
36+
[stream]: https://godoc.org/github.com/dubbogo/grpc-go#Stream
3737
[say-hello]: https://github.com/grpc/grpc-go/blob/master/examples/helloworld/greeter_server/main.go#L41
3838
[route-guide-stream]: https://github.com/grpc/grpc-go/blob/master/examples/route_guide/server/server.go#L126
3939
[multiplex-example]: https://github.com/grpc/grpc-go/tree/master/examples/features/multiplex

Documentation/encoding.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ that registers itself, and is imported anonymously. For example:
1919
```go
2020
package proto
2121

22-
import "google.golang.org/grpc/encoding"
22+
import "github.com/dubbogo/grpc-go/encoding"
2323

2424
func init() {
2525
encoding.RegisterCodec(protoCodec{})
@@ -29,7 +29,7 @@ func init() {
2929
```
3030

3131
For an example, gRPC's implementation of the `proto` codec can be found in
32-
[`encoding/proto`](https://godoc.org/google.golang.org/grpc/encoding/proto).
32+
[`encoding/proto`](https://godoc.org/github.com/dubbogo/grpc-go/encoding/proto).
3333

3434
### Using a `Codec`
3535

@@ -95,7 +95,7 @@ function that registers itself, and is imported anonymously. For example:
9595
```go
9696
package gzip
9797

98-
import "google.golang.org/grpc/encoding"
98+
import "github.com/dubbogo/grpc-go/encoding"
9999

100100
func init() {
101101
encoding.RegisterCompressor(compressor{})
@@ -105,7 +105,7 @@ func init() {
105105
```
106106

107107
An implementation of a `gzip` compressor can be found in
108-
[`encoding/gzip`](https://godoc.org/google.golang.org/grpc/encoding/gzip).
108+
[`encoding/gzip`](https://godoc.org/github.com/dubbogo/grpc-go/encoding/gzip).
109109

110110
### Using a `Compressor`
111111

@@ -115,7 +115,7 @@ By default, gRPC does not register or use any compressors. To use a
115115
```go
116116
package myclient
117117

118-
import _ "google.golang.org/grpc/encoding/gzip"
118+
import _ "github.com/dubbogo/grpc-go/encoding/gzip"
119119
```
120120

121121
`Compressor`s, by definition, must be symmetric, so the same desired

Documentation/grpc-auth-support.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,33 @@ For an example of how to configure client and server to use OAuth2 tokens, see
2929
## Validating a token on the server
3030

3131
Clients may use
32-
[metadata.MD](https://godoc.org/google.golang.org/grpc/metadata#MD)
32+
[metadata.MD](https://godoc.org/github.com/dubbogo/grpc-go/metadata#MD)
3333
to store tokens and other authentication-related data. To gain access to the
3434
`metadata.MD` object, a server may use
35-
[metadata.FromIncomingContext](https://godoc.org/google.golang.org/grpc/metadata#FromIncomingContext).
35+
[metadata.FromIncomingContext](https://godoc.org/github.com/dubbogo/grpc-go/metadata#FromIncomingContext).
3636
With a reference to `metadata.MD` on the server, one needs to simply lookup the
3737
`authorization` key. Note, all keys stored within `metadata.MD` are normalized
38-
to lowercase. See [here](https://godoc.org/google.golang.org/grpc/metadata#New).
38+
to lowercase. See [here](https://godoc.org/github.com/dubbogo/grpc-go/metadata#New).
3939

4040
It is possible to configure token validation for all RPCs using an interceptor.
4141
A server may configure either a
42-
[grpc.UnaryInterceptor](https://godoc.org/google.golang.org/grpc#UnaryInterceptor)
42+
[grpc.UnaryInterceptor](https://godoc.org/github.com/dubbogo/grpc-go#UnaryInterceptor)
4343
or a
44-
[grpc.StreamInterceptor](https://godoc.org/google.golang.org/grpc#StreamInterceptor).
44+
[grpc.StreamInterceptor](https://godoc.org/github.com/dubbogo/grpc-go#StreamInterceptor).
4545

4646
## Adding a token to all outgoing client RPCs
4747

4848
To send an OAuth2 token with each RPC, a client may configure the
4949
`grpc.DialOption`
50-
[grpc.WithPerRPCCredentials](https://godoc.org/google.golang.org/grpc#WithPerRPCCredentials).
50+
[grpc.WithPerRPCCredentials](https://godoc.org/github.com/dubbogo/grpc-go#WithPerRPCCredentials).
5151
Alternatively, a client may also use the `grpc.CallOption`
52-
[grpc.PerRPCCredentials](https://godoc.org/google.golang.org/grpc#PerRPCCredentials)
52+
[grpc.PerRPCCredentials](https://godoc.org/github.com/dubbogo/grpc-go#PerRPCCredentials)
5353
on each invocation of an RPC.
5454

5555
To create a `credentials.PerRPCCredentials`, use
56-
[oauth.NewOauthAccess](https://godoc.org/google.golang.org/grpc/credentials/oauth#NewOauthAccess).
56+
[oauth.NewOauthAccess](https://godoc.org/github.com/dubbogo/grpc-go/credentials/oauth#NewOauthAccess).
5757
Note, the OAuth2 implementation of `grpc.PerRPCCredentials` requires a client to use
58-
[grpc.WithTransportCredentials](https://godoc.org/google.golang.org/grpc#WithTransportCredentials)
58+
[grpc.WithTransportCredentials](https://godoc.org/github.com/dubbogo/grpc-go#WithTransportCredentials)
5959
to prevent any insecure transmission of tokens.
6060

6161
# Authenticating with Google

Documentation/grpc-metadata.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ And concept of [metadata](https://grpc.io/docs/guides/concepts.html#metadata).
1616

1717
## Constructing metadata
1818

19-
A metadata can be created using package [metadata](https://godoc.org/google.golang.org/grpc/metadata).
19+
A metadata can be created using package [metadata](https://godoc.org/github.com/dubbogo/grpc-go/metadata).
2020
The type MD is actually a map from string to a list of strings:
2121

2222
```go
@@ -127,7 +127,7 @@ Metadata that a client can receive includes header and trailer.
127127

128128
#### Unary call
129129

130-
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):
130+
Header and trailer sent along with a unary call can be retrieved using function [Header](https://godoc.org/github.com/dubbogo/grpc-go#Header) and [Trailer](https://godoc.org/github.com/dubbogo/grpc-go#Trailer) in [CallOption](https://godoc.org/github.com/dubbogo/grpc-go#CallOption):
131131

132132
```go
133133
var header, trailer metadata.MD // variable to store header and trailer
@@ -149,7 +149,7 @@ For streaming calls including:
149149
- Client streaming RPC
150150
- Bidirectional streaming RPC
151151

152-
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):
152+
Header and trailer can be retrieved from the returned stream using function `Header` and `Trailer` in interface [ClientStream](https://godoc.org/github.com/dubbogo/grpc-go#ClientStream):
153153

154154
```go
155155
stream, err := client.SomeStreamingRPC(ctx)
@@ -194,7 +194,7 @@ func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) erro
194194

195195
#### Unary call
196196

197-
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).
197+
To send header and trailer to client in unary call, the server can call [SendHeader](https://godoc.org/github.com/dubbogo/grpc-go#SendHeader) and [SetTrailer](https://godoc.org/github.com/dubbogo/grpc-go#SetTrailer) functions in module [grpc](https://godoc.org/github.com/dubbogo/grpc-go).
198198
These two functions take a context as the first parameter.
199199
It should be the RPC handler's context or one derived from it:
200200

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

212212
#### Streaming call
213213

214-
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):
214+
For streaming calls, header and trailer can be sent using function `SendHeader` and `SetTrailer` in interface [ServerStream](https://godoc.org/github.com/dubbogo/grpc-go#ServerStream):
215215

216216
```go
217217
func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) error {

Documentation/keepalive.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ connection will be closed. Note that pings are only necessary when there's no
66
activity on the connection.
77

88
For how to configure keepalive, see
9-
https://godoc.org/google.golang.org/grpc/keepalive for the options.
9+
https://godoc.org/github.com/dubbogo/grpc-go/keepalive for the options.
1010

1111
## Why do I need this?
1212

@@ -22,8 +22,8 @@ Sending pings would make the connections not "idle".
2222
## What should I set?
2323

2424
It should be sufficient for most users to set [client
25-
parameters](https://godoc.org/google.golang.org/grpc/keepalive) as a [dial
26-
option](https://godoc.org/google.golang.org/grpc#WithKeepaliveParams).
25+
parameters](https://godoc.org/github.com/dubbogo/grpc-go/keepalive) as a [dial
26+
option](https://godoc.org/github.com/dubbogo/grpc-go#WithKeepaliveParams).
2727

2828
## What will happen?
2929

@@ -40,13 +40,13 @@ connection during this period (a ping ack is an activity).
4040

4141
Server has similar `Time` and `Timeout` settings as client. Server can also
4242
configure connection max-age. See [server
43-
parameters](https://godoc.org/google.golang.org/grpc/keepalive#ServerParameters)
43+
parameters](https://godoc.org/github.com/dubbogo/grpc-go/keepalive#ServerParameters)
4444
for details.
4545

4646
### Enforcement policy
4747

4848
[Enforcement
49-
policy](https://godoc.org/google.golang.org/grpc/keepalive#EnforcementPolicy) is
49+
policy](https://godoc.org/github.com/dubbogo/grpc-go/keepalive#EnforcementPolicy) is
5050
a special setting on server side to protect server from malicious or misbehaving
5151
clients.
5252

Documentation/proxy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ connection before giving it to gRPC.
1212

1313
If the default proxy doesn't work for you, replace the default dialer with your
1414
custom proxy dialer. This can be done using
15-
[`WithDialer`](https://godoc.org/google.golang.org/grpc#WithDialer).
15+
[`WithDialer`](https://godoc.org/github.com/dubbogo/grpc-go#WithDialer).

Documentation/rpc-errors.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ receives an error with details:
5858
exit status 1
5959
```
6060

61-
[status]: https://godoc.org/google.golang.org/grpc/status#Status
62-
[new-status]: https://godoc.org/google.golang.org/grpc/status#New
63-
[code]: https://godoc.org/google.golang.org/grpc/codes#Code
64-
[with-details]: https://godoc.org/google.golang.org/grpc/internal/status#Status.WithDetails
65-
[details]: https://godoc.org/google.golang.org/grpc/internal/status#Status.Details
66-
[status-err]: https://godoc.org/google.golang.org/grpc/internal/status#Status.Err
67-
[status-error]: https://godoc.org/google.golang.org/grpc/status#Error
61+
[status]: https://godoc.org/github.com/dubbogo/grpc-go/status#Status
62+
[new-status]: https://godoc.org/github.com/dubbogo/grpc-go/status#New
63+
[code]: https://godoc.org/github.com/dubbogo/grpc-go/codes#Code
64+
[with-details]: https://godoc.org/github.com/dubbogo/grpc-go/internal/status#Status.WithDetails
65+
[details]: https://godoc.org/github.com/dubbogo/grpc-go/internal/status#Status.Details
66+
[status-err]: https://godoc.org/github.com/dubbogo/grpc-go/internal/status#Status.Err
67+
[status-error]: https://godoc.org/github.com/dubbogo/grpc-go/status#Error
6868
[example]: https://github.com/grpc/grpc-go/tree/master/examples/features/errors

Documentation/server-reflection-tutorial.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ make the following changes:
1919
--- a/examples/helloworld/greeter_server/main.go
2020
+++ b/examples/helloworld/greeter_server/main.go
2121
@@ -40,6 +40,7 @@ import (
22-
"google.golang.org/grpc"
23-
pb "google.golang.org/grpc/examples/helloworld/helloworld"
24-
+ "google.golang.org/grpc/reflection"
22+
"github.com/dubbogo/grpc-go"
23+
pb "github.com/dubbogo/grpc-go/examples/helloworld/helloworld"
24+
+ "github.com/dubbogo/grpc-go/reflection"
2525
)
2626

2727
const (

Makefile

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
all: vet test testrace
22

33
build:
4-
go build google.golang.org/grpc/...
4+
go build github.com/dubbogo/grpc-go/...
55

66
clean:
7-
go clean -i google.golang.org/grpc/...
7+
go clean -i github.com/dubbogo/grpc-go/...
88

99
deps:
10-
GO111MODULE=on go get -d -v google.golang.org/grpc/...
10+
GO111MODULE=on go get -d -v github.com/dubbogo/grpc-go/...
1111

1212
proto:
1313
@ if ! which protoc > /dev/null; then \
1414
echo "error: protoc not installed" >&2; \
1515
exit 1; \
1616
fi
17-
go generate google.golang.org/grpc/...
17+
go generate github.com/dubbogo/grpc-go/...
1818

1919
test:
20-
go test -cpu 1,4 -timeout 7m google.golang.org/grpc/...
20+
go test -cpu 1,4 -timeout 7m github.com/dubbogo/grpc-go/...
2121

2222
testsubmodule:
23-
cd security/advancedtls && go test -cpu 1,4 -timeout 7m google.golang.org/grpc/security/advancedtls/...
24-
cd security/authorization && go test -cpu 1,4 -timeout 7m google.golang.org/grpc/security/authorization/...
23+
cd security/advancedtls && go test -cpu 1,4 -timeout 7m github.com/dubbogo/grpc-go/security/advancedtls/...
24+
cd security/authorization && go test -cpu 1,4 -timeout 7m github.com/dubbogo/grpc-go/security/authorization/...
2525

2626
testrace:
27-
go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/...
27+
go test -race -cpu 1,4 -timeout 7m github.com/dubbogo/grpc-go/...
2828

2929
testdeps:
30-
GO111MODULE=on go get -d -v -t google.golang.org/grpc/...
30+
GO111MODULE=on go get -d -v -t github.com/dubbogo/grpc-go/...
3131

3232
vet: vetdeps
3333
./vet.sh

0 commit comments

Comments
 (0)