Skip to content

Commit 2205d27

Browse files
authored
feat(bigtable/spanner): allow disable gRPC DirectPath deps (googleapis#12469)
* feat(spanner): allow disable gRPC PD deps * feat(bigtable): allow disable gRPC PD deps
1 parent 7994c2c commit 2205d27

File tree

4 files changed

+48
-10
lines changed

4 files changed

+48
-10
lines changed

bigtable/bigtable.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ import (
4747
"google.golang.org/grpc/status"
4848
"google.golang.org/protobuf/proto"
4949
"google.golang.org/protobuf/types/known/timestamppb"
50-
51-
// Install google-c2p resolver, which is required for direct path.
52-
_ "google.golang.org/grpc/xds/googledirectpath"
53-
// Install RLS load balancer policy, which is needed for gRPC RLS.
54-
_ "google.golang.org/grpc/balancer/rls"
5550
)
5651

5752
const prodAddr = "bigtable.googleapis.com:443"

bigtable/grpc_dp.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//go:build !disable_grpc_modules
2+
3+
// Copyright 2025 Google LLC
4+
//
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
package bigtable
18+
19+
import (
20+
// Install google-c2p resolver, which is required for direct path.
21+
_ "google.golang.org/grpc/xds/googledirectpath"
22+
// Install RLS load balancer policy, which is needed for gRPC RLS.
23+
_ "google.golang.org/grpc/balancer/rls"
24+
)

spanner/client.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ import (
5050

5151
vkit "cloud.google.com/go/spanner/apiv1"
5252
"cloud.google.com/go/spanner/internal"
53-
54-
// Install google-c2p resolver, which is required for direct path.
55-
_ "google.golang.org/grpc/xds/googledirectpath"
56-
// Install RLS load balancer policy, which is needed for gRPC RLS.
57-
_ "google.golang.org/grpc/balancer/rls"
5853
)
5954

6055
const (

spanner/grpc_dp.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//go:build !disable_grpc_modules
2+
3+
// Copyright 2025 Google LLC
4+
//
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
package spanner
18+
19+
import (
20+
// Install google-c2p resolver, which is required for direct path.
21+
_ "google.golang.org/grpc/xds/googledirectpath"
22+
// Install RLS load balancer policy, which is needed for gRPC RLS.
23+
_ "google.golang.org/grpc/balancer/rls"
24+
)

0 commit comments

Comments
 (0)