Skip to content

Commit cc345b1

Browse files
ftr: server stream set context support
1 parent c1d1882 commit cc345b1

File tree

524 files changed

+2264
-568
lines changed

Some content is hidden

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

524 files changed

+2264
-568
lines changed

admin/admin_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ package admin_test
2020

2121
import (
2222
"testing"
23+
)
2324

25+
import (
2426
"github.com/dubbogo/grpc-go/admin/test"
2527
"github.com/dubbogo/grpc-go/codes"
2628
)

admin/test/admin_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ package test_test
2424

2525
import (
2626
"testing"
27+
)
2728

29+
import (
2830
"github.com/dubbogo/grpc-go/admin/test"
2931
"github.com/dubbogo/grpc-go/codes"
3032
_ "github.com/dubbogo/grpc-go/xds"

admin/test/utils.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,22 @@ import (
2525
"net"
2626
"testing"
2727
"time"
28+
)
29+
30+
import (
31+
v3statusgrpc "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
32+
v3statuspb "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
33+
34+
"github.com/google/uuid"
35+
)
2836

37+
import (
2938
"github.com/dubbogo/grpc-go"
3039
"github.com/dubbogo/grpc-go/admin"
3140
channelzpb "github.com/dubbogo/grpc-go/channelz/grpc_channelz_v1"
3241
"github.com/dubbogo/grpc-go/codes"
3342
"github.com/dubbogo/grpc-go/internal/xds"
3443
"github.com/dubbogo/grpc-go/status"
35-
v3statusgrpc "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
36-
v3statuspb "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
37-
"github.com/google/uuid"
3844
)
3945

4046
const (

attributes/attributes_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ package attributes_test
2121
import (
2222
"fmt"
2323
"testing"
24+
)
2425

26+
import (
2527
"github.com/dubbogo/grpc-go/attributes"
2628
)
2729

authz/rbac_translator.go

+2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ import (
2727
"encoding/json"
2828
"fmt"
2929
"strings"
30+
)
3031

32+
import (
3133
v3rbacpb "github.com/envoyproxy/go-control-plane/envoy/config/rbac/v3"
3234
v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
3335
v3matcherpb "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"

authz/rbac_translator_test.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ package authz
2121
import (
2222
"strings"
2323
"testing"
24+
)
2425

25-
"github.com/google/go-cmp/cmp"
26-
"google.golang.org/protobuf/testing/protocmp"
27-
26+
import (
2827
v3rbacpb "github.com/envoyproxy/go-control-plane/envoy/config/rbac/v3"
2928
v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
3029
v3matcherpb "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
30+
31+
"github.com/google/go-cmp/cmp"
32+
33+
"google.golang.org/protobuf/testing/protocmp"
3134
)
3235

3336
func TestTranslatePolicy(t *testing.T) {

authz/sdk_end2end_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ import (
2828
"os"
2929
"testing"
3030
"time"
31+
)
3132

33+
import (
3234
"github.com/dubbogo/grpc-go"
3335
"github.com/dubbogo/grpc-go/authz"
3436
"github.com/dubbogo/grpc-go/codes"

authz/sdk_server_interceptors.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ import (
2020
"bytes"
2121
"context"
2222
"fmt"
23-
"github.com/dubbogo/grpc-go/internal/xds/rbac"
2423
"io/ioutil"
2524
"sync/atomic"
2625
"time"
2726
"unsafe"
27+
)
2828

29+
import (
2930
"github.com/dubbogo/grpc-go"
3031
"github.com/dubbogo/grpc-go/codes"
3132
"github.com/dubbogo/grpc-go/grpclog"
33+
"github.com/dubbogo/grpc-go/internal/xds/rbac"
3234
"github.com/dubbogo/grpc-go/status"
3335
)
3436

authz/sdk_server_interceptors_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import (
2525
"path"
2626
"testing"
2727
"time"
28+
)
2829

30+
import (
2931
"github.com/dubbogo/grpc-go/authz"
3032
)
3133

backoff.go

+2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ package grpc
2323

2424
import (
2525
"time"
26+
)
2627

28+
import (
2729
"github.com/dubbogo/grpc-go/backoff"
2830
)
2931

backoff/backoff.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
// All APIs in this package are experimental.
2525
package backoff
2626

27-
import "time"
27+
import (
28+
"time"
29+
)
2830

2931
// Config defines the configuration options for backoff.
3032
type Config struct {

balancer/balancer.go

+2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ import (
2626
"errors"
2727
"net"
2828
"strings"
29+
)
2930

31+
import (
3032
"github.com/dubbogo/grpc-go/connectivity"
3133
"github.com/dubbogo/grpc-go/credentials"
3234
"github.com/dubbogo/grpc-go/internal"

balancer/base/balancer.go

+2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ package base
2121
import (
2222
"errors"
2323
"fmt"
24+
)
2425

26+
import (
2527
"github.com/dubbogo/grpc-go/balancer"
2628
"github.com/dubbogo/grpc-go/connectivity"
2729
"github.com/dubbogo/grpc-go/grpclog"

balancer/base/balancer_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ package base
2020

2121
import (
2222
"testing"
23+
)
2324

25+
import (
2426
"github.com/dubbogo/grpc-go/attributes"
2527
"github.com/dubbogo/grpc-go/balancer"
2628
"github.com/dubbogo/grpc-go/connectivity"

balancer/grpclb/grpc_lb_v1/load_balancer.pb.go

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

balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go

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

balancer/grpclb/grpclb.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ import (
2828
"fmt"
2929
"sync"
3030
"time"
31+
)
32+
33+
import (
34+
durationpb "github.com/golang/protobuf/ptypes/duration"
35+
)
3136

37+
import (
3238
"github.com/dubbogo/grpc-go"
3339
"github.com/dubbogo/grpc-go/balancer"
40+
lbpb "github.com/dubbogo/grpc-go/balancer/grpclb/grpc_lb_v1"
3441
grpclbstate "github.com/dubbogo/grpc-go/balancer/grpclb/state"
3542
"github.com/dubbogo/grpc-go/connectivity"
3643
"github.com/dubbogo/grpc-go/credentials"
@@ -39,9 +46,6 @@ import (
3946
"github.com/dubbogo/grpc-go/internal/backoff"
4047
"github.com/dubbogo/grpc-go/internal/resolver/dns"
4148
"github.com/dubbogo/grpc-go/resolver"
42-
43-
lbpb "github.com/dubbogo/grpc-go/balancer/grpclb/grpc_lb_v1"
44-
durationpb "github.com/golang/protobuf/ptypes/duration"
4549
)
4650

4751
const (

balancer/grpclb/grpclb_config.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ package grpclb
2020

2121
import (
2222
"encoding/json"
23+
)
2324

25+
import (
2426
"github.com/dubbogo/grpc-go"
2527
"github.com/dubbogo/grpc-go/balancer/roundrobin"
2628
"github.com/dubbogo/grpc-go/serviceconfig"

balancer/grpclb/grpclb_config_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ package grpclb
2121
import (
2222
"encoding/json"
2323
"testing"
24+
)
2425

25-
"github.com/dubbogo/grpc-go/serviceconfig"
26+
import (
2627
"github.com/google/go-cmp/cmp"
2728
)
2829

30+
import (
31+
"github.com/dubbogo/grpc-go/serviceconfig"
32+
)
33+
2934
func (s) TestParse(t *testing.T) {
3035
tests := []struct {
3136
name string

balancer/grpclb/grpclb_picker.go

+2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ package grpclb
2121
import (
2222
"sync"
2323
"sync/atomic"
24+
)
2425

26+
import (
2527
"github.com/dubbogo/grpc-go/balancer"
2628
lbpb "github.com/dubbogo/grpc-go/balancer/grpclb/grpc_lb_v1"
2729
"github.com/dubbogo/grpc-go/codes"

balancer/grpclb/grpclb_remote_balancer.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,16 @@ import (
2525
"net"
2626
"sync"
2727
"time"
28+
)
29+
30+
import (
31+
"github.com/golang/protobuf/proto"
32+
timestamppb "github.com/golang/protobuf/ptypes/timestamp"
33+
34+
"github.com/google/go-cmp/cmp"
35+
)
2836

37+
import (
2938
"github.com/dubbogo/grpc-go"
3039
"github.com/dubbogo/grpc-go/balancer"
3140
lbpb "github.com/dubbogo/grpc-go/balancer/grpclb/grpc_lb_v1"
@@ -36,9 +45,6 @@ import (
3645
"github.com/dubbogo/grpc-go/keepalive"
3746
"github.com/dubbogo/grpc-go/metadata"
3847
"github.com/dubbogo/grpc-go/resolver"
39-
"github.com/golang/protobuf/proto"
40-
timestamppb "github.com/golang/protobuf/ptypes/timestamp"
41-
"github.com/google/go-cmp/cmp"
4248
)
4349

4450
// processServerList updates balancer's internal state, create/remove SubConns

balancer/grpclb/grpclb_test.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,20 @@ import (
3030
"sync/atomic"
3131
"testing"
3232
"time"
33+
)
34+
35+
import (
36+
durationpb "github.com/golang/protobuf/ptypes/duration"
3337

3438
"github.com/google/go-cmp/cmp"
3539
"github.com/google/go-cmp/cmp/cmpopts"
40+
)
3641

42+
import (
3743
"github.com/dubbogo/grpc-go"
3844
"github.com/dubbogo/grpc-go/balancer"
45+
lbgrpc "github.com/dubbogo/grpc-go/balancer/grpclb/grpc_lb_v1"
46+
lbpb "github.com/dubbogo/grpc-go/balancer/grpclb/grpc_lb_v1"
3947
grpclbstate "github.com/dubbogo/grpc-go/balancer/grpclb/state"
4048
"github.com/dubbogo/grpc-go/codes"
4149
"github.com/dubbogo/grpc-go/credentials"
@@ -46,11 +54,7 @@ import (
4654
"github.com/dubbogo/grpc-go/resolver"
4755
"github.com/dubbogo/grpc-go/resolver/manual"
4856
"github.com/dubbogo/grpc-go/status"
49-
50-
lbgrpc "github.com/dubbogo/grpc-go/balancer/grpclb/grpc_lb_v1"
51-
lbpb "github.com/dubbogo/grpc-go/balancer/grpclb/grpc_lb_v1"
5257
testpb "github.com/dubbogo/grpc-go/test/grpc_testing"
53-
durationpb "github.com/golang/protobuf/ptypes/duration"
5458
)
5559

5660
var (

balancer/grpclb/grpclb_util.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ import (
2222
"fmt"
2323
"sync"
2424
"time"
25+
)
2526

27+
import (
2628
"github.com/dubbogo/grpc-go/balancer"
2729
"github.com/dubbogo/grpc-go/resolver"
2830
)
@@ -52,7 +54,6 @@ import (
5254
// | + + | + + | |
5355
// | +---------------------------------+ |
5456
// +-----------------------------------------------------------------+
55-
5657
// lbManualResolver is used by the ClientConn inside grpclb. It's a manual
5758
// resolver with a special ResolveNow() function.
5859
//

balancer/grpclb/grpclb_util_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ import (
2323
"sync"
2424
"testing"
2525
"time"
26+
)
2627

28+
import (
2729
"github.com/dubbogo/grpc-go/balancer"
2830
"github.com/dubbogo/grpc-go/resolver"
2931
)

balancer/rls/internal/adaptive/adaptive.go

+2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ package adaptive
2222
import (
2323
"sync"
2424
"time"
25+
)
2526

27+
import (
2628
"github.com/dubbogo/grpc-go/internal/grpcrand"
2729
)
2830

balancer/rls/internal/adaptive/lookback.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
package adaptive
2020

21-
import "time"
21+
import (
22+
"time"
23+
)
2224

2325
// lookback implements a moving sum over an int64 timeline.
2426
type lookback struct {

balancer/rls/internal/balancer.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ package rls
2020

2121
import (
2222
"sync"
23+
)
2324

25+
import (
2426
"github.com/dubbogo/grpc-go"
2527
"github.com/dubbogo/grpc-go/balancer"
2628
"github.com/dubbogo/grpc-go/grpclog"

0 commit comments

Comments
 (0)