Move code out of balancer/xds. (#2950)
We will have a root level xds/ directory which will eventually contain all xDS implementation including balancer, resolver, client etc. The new structure looks something like this: grpc/ | +--xds/ | +--internal/ | | | +--balancer/ | | | +--edsbalancer/ | | | +--lrs/ | | | +--orca/ | +--experimental/ Users need to import grpc/xds/experimental package to get all xds functionality, and this will eventually be moved to grpc/xds. Also, moved grpc/balancer/internal/wrr to grpc/internal/wrr.
This commit is contained in:

committed by
GitHub

parent
fde0cae1c4
commit
36ddeccf18
6
vet.sh
6
vet.sh
@ -110,9 +110,9 @@ staticcheck -go 1.9 -checks 'inherit,-ST1015' -ignore '
|
|||||||
google.golang.org/grpc/balancer.go:SA1019
|
google.golang.org/grpc/balancer.go:SA1019
|
||||||
google.golang.org/grpc/balancer/grpclb/grpclb_remote_balancer.go:SA1019
|
google.golang.org/grpc/balancer/grpclb/grpclb_remote_balancer.go:SA1019
|
||||||
google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go:SA1019
|
google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go:SA1019
|
||||||
google.golang.org/grpc/balancer/xds/edsbalancer/balancergroup.go:SA1019
|
google.golang.org/grpc/xds/internal/balancer/edsbalancer/balancergroup.go:SA1019
|
||||||
google.golang.org/grpc/balancer/xds/xds.go:SA1019
|
google.golang.org/grpc/xds/internal/balancer/xds.go:SA1019
|
||||||
google.golang.org/grpc/balancer/xds/xds_client.go:SA1019
|
google.golang.org/grpc/xds/internal/balancer/xds_client.go:SA1019
|
||||||
google.golang.org/grpc/balancer_conn_wrappers.go:SA1019
|
google.golang.org/grpc/balancer_conn_wrappers.go:SA1019
|
||||||
google.golang.org/grpc/balancer_test.go:SA1019
|
google.golang.org/grpc/balancer_test.go:SA1019
|
||||||
google.golang.org/grpc/benchmark/benchmain/main.go:SA1019
|
google.golang.org/grpc/benchmark/benchmain/main.go:SA1019
|
||||||
|
32
xds/experimental/xds_experimental.go
Normal file
32
xds/experimental/xds_experimental.go
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019 gRPC authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Package experimental contains xds implementation, still in experimental
|
||||||
|
// state. Users only need to import this package to get all xds functionality.
|
||||||
|
// Things are expected to change fast until we get to a stable state, at
|
||||||
|
// which point, all this will be moved to the xds package.
|
||||||
|
package experimental
|
||||||
|
|
||||||
|
import (
|
||||||
|
"google.golang.org/grpc/balancer"
|
||||||
|
xdsbalancer "google.golang.org/grpc/xds/internal/balancer"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
balancer.Register(xdsbalancer.NewBalancerBuilder())
|
||||||
|
}
|
@ -22,13 +22,13 @@ import (
|
|||||||
|
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/base"
|
"google.golang.org/grpc/balancer/base"
|
||||||
"google.golang.org/grpc/balancer/internal/wrr"
|
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
orcapb "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
|
||||||
"google.golang.org/grpc/balancer/xds/lrs"
|
|
||||||
"google.golang.org/grpc/connectivity"
|
"google.golang.org/grpc/connectivity"
|
||||||
"google.golang.org/grpc/grpclog"
|
"google.golang.org/grpc/grpclog"
|
||||||
|
"google.golang.org/grpc/internal/wrr"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
"google.golang.org/grpc/xds/internal/balancer/lrs"
|
||||||
|
orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pickerState struct {
|
type pickerState struct {
|
@ -23,10 +23,10 @@ import (
|
|||||||
|
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/roundrobin"
|
"google.golang.org/grpc/balancer/roundrobin"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
orcapb "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
|
||||||
"google.golang.org/grpc/connectivity"
|
"google.golang.org/grpc/connectivity"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
@ -28,16 +28,16 @@ import (
|
|||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/roundrobin"
|
"google.golang.org/grpc/balancer/roundrobin"
|
||||||
"google.golang.org/grpc/balancer/weightedroundrobin"
|
"google.golang.org/grpc/balancer/weightedroundrobin"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
|
|
||||||
endpointpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
|
|
||||||
percentpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent"
|
|
||||||
"google.golang.org/grpc/balancer/xds/lrs"
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/connectivity"
|
"google.golang.org/grpc/connectivity"
|
||||||
"google.golang.org/grpc/grpclog"
|
"google.golang.org/grpc/grpclog"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
"google.golang.org/grpc/xds/internal/balancer/lrs"
|
||||||
|
edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds"
|
||||||
|
endpointpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
|
||||||
|
percentpb "google.golang.org/grpc/xds/internal/proto/envoy/type/percent"
|
||||||
)
|
)
|
||||||
|
|
||||||
type localityConfig struct {
|
type localityConfig struct {
|
@ -27,14 +27,14 @@ import (
|
|||||||
typespb "github.com/golang/protobuf/ptypes/wrappers"
|
typespb "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/roundrobin"
|
"google.golang.org/grpc/balancer/roundrobin"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
addresspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address"
|
|
||||||
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
|
||||||
edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
|
|
||||||
endpointpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
|
|
||||||
percentpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent"
|
|
||||||
"google.golang.org/grpc/connectivity"
|
"google.golang.org/grpc/connectivity"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
addresspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address"
|
||||||
|
basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
|
edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds"
|
||||||
|
endpointpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
|
||||||
|
percentpb "google.golang.org/grpc/xds/internal/proto/envoy/type/percent"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
@ -23,9 +23,9 @@ import (
|
|||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
"google.golang.org/grpc/connectivity"
|
"google.golang.org/grpc/connectivity"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package edsbalancer
|
package edsbalancer
|
||||||
|
|
||||||
import "google.golang.org/grpc/balancer/internal/wrr"
|
import "google.golang.org/grpc/internal/wrr"
|
||||||
|
|
||||||
type dropper struct {
|
type dropper struct {
|
||||||
// Drop rate will be numerator/denominator.
|
// Drop rate will be numerator/denominator.
|
@ -20,7 +20,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"google.golang.org/grpc/balancer/internal/wrr"
|
"google.golang.org/grpc/internal/wrr"
|
||||||
)
|
)
|
||||||
|
|
||||||
// testWRR is a deterministic WRR implementation.
|
// testWRR is a deterministic WRR implementation.
|
@ -26,13 +26,13 @@ import (
|
|||||||
"github.com/golang/protobuf/ptypes"
|
"github.com/golang/protobuf/ptypes"
|
||||||
structpb "github.com/golang/protobuf/ptypes/struct"
|
structpb "github.com/golang/protobuf/ptypes/struct"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
|
||||||
loadreportpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report"
|
|
||||||
lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
|
||||||
lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
|
||||||
"google.golang.org/grpc/grpclog"
|
"google.golang.org/grpc/grpclog"
|
||||||
"google.golang.org/grpc/internal/backoff"
|
"google.golang.org/grpc/internal/backoff"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
|
loadreportpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/load_report"
|
||||||
|
lrsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
||||||
|
lrspb "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const negativeOneUInt64 = ^uint64(0)
|
const negativeOneUInt64 = ^uint64(0)
|
@ -33,13 +33,13 @@ import (
|
|||||||
structpb "github.com/golang/protobuf/ptypes/struct"
|
structpb "github.com/golang/protobuf/ptypes/struct"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
|
||||||
loadreportpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report"
|
|
||||||
lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
|
||||||
lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
|
loadreportpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/load_report"
|
||||||
|
lrsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
||||||
|
lrspb "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const testService = "grpc.service.test"
|
const testService = "grpc.service.test"
|
@ -19,10 +19,10 @@ package orca
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
orcapb "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
|
||||||
"google.golang.org/grpc/grpclog"
|
"google.golang.org/grpc/grpclog"
|
||||||
"google.golang.org/grpc/internal/balancerload"
|
"google.golang.org/grpc/internal/balancerload"
|
||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
|
orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
||||||
)
|
)
|
||||||
|
|
||||||
const mdKey = "X-Endpoint-Load-Metrics-Bin"
|
const mdKey = "X-Endpoint-Load-Metrics-Bin"
|
@ -22,8 +22,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
orcapb "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
|
||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
|
orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
@ -16,9 +16,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Package xds implements a balancer that communicates with a remote balancer using the Envoy xDS
|
// Package balancer contains xds balancer implementation.
|
||||||
// protocol.
|
package balancer
|
||||||
package xds
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -30,14 +29,14 @@ import (
|
|||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/xds/edsbalancer"
|
|
||||||
cdspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cds"
|
|
||||||
edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
|
|
||||||
"google.golang.org/grpc/balancer/xds/lrs"
|
|
||||||
"google.golang.org/grpc/connectivity"
|
"google.golang.org/grpc/connectivity"
|
||||||
"google.golang.org/grpc/grpclog"
|
"google.golang.org/grpc/grpclog"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
"google.golang.org/grpc/serviceconfig"
|
"google.golang.org/grpc/serviceconfig"
|
||||||
|
"google.golang.org/grpc/xds/internal/balancer/edsbalancer"
|
||||||
|
"google.golang.org/grpc/xds/internal/balancer/lrs"
|
||||||
|
cdspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cds"
|
||||||
|
edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -55,13 +54,11 @@ var (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
balancer.Register(newXDSBalancerBuilder())
|
|
||||||
}
|
|
||||||
|
|
||||||
type xdsBalancerBuilder struct{}
|
type xdsBalancerBuilder struct{}
|
||||||
|
|
||||||
func newXDSBalancerBuilder() balancer.Builder {
|
// NewBalancerBuilder creates a new implementation of the balancer.Builder
|
||||||
|
// interface for the xDS balancer.
|
||||||
|
func NewBalancerBuilder() balancer.Builder {
|
||||||
return &xdsBalancerBuilder{}
|
return &xdsBalancerBuilder{}
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package xds
|
package balancer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -28,16 +28,16 @@ import (
|
|||||||
structpb "github.com/golang/protobuf/ptypes/struct"
|
structpb "github.com/golang/protobuf/ptypes/struct"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
cdspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cds"
|
|
||||||
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
|
||||||
discoverypb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery"
|
|
||||||
edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
|
|
||||||
adsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/discovery/v2/ads"
|
|
||||||
"google.golang.org/grpc/balancer/xds/lrs"
|
|
||||||
"google.golang.org/grpc/grpclog"
|
"google.golang.org/grpc/grpclog"
|
||||||
"google.golang.org/grpc/internal/backoff"
|
"google.golang.org/grpc/internal/backoff"
|
||||||
"google.golang.org/grpc/internal/channelz"
|
"google.golang.org/grpc/internal/channelz"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
"google.golang.org/grpc/xds/internal/balancer/lrs"
|
||||||
|
cdspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cds"
|
||||||
|
basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
|
discoverypb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery"
|
||||||
|
edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds"
|
||||||
|
adsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/discovery/v2/ads"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package xds
|
package balancer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -33,18 +33,18 @@ import (
|
|||||||
wrpb "github.com/golang/protobuf/ptypes/wrappers"
|
wrpb "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
cdspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cds"
|
|
||||||
addresspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address"
|
|
||||||
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
|
||||||
discoverypb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery"
|
|
||||||
edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
|
|
||||||
endpointpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
|
|
||||||
adsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/discovery/v2/ads"
|
|
||||||
lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
cdspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cds"
|
||||||
|
addresspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address"
|
||||||
|
basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
|
discoverypb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery"
|
||||||
|
edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds"
|
||||||
|
endpointpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
|
||||||
|
adsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/discovery/v2/ads"
|
||||||
|
lrsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package xds
|
package balancer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
@ -29,13 +29,13 @@ import (
|
|||||||
structpb "github.com/golang/protobuf/ptypes/struct"
|
structpb "github.com/golang/protobuf/ptypes/struct"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/xds/internal"
|
|
||||||
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
|
||||||
lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
|
||||||
lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"google.golang.org/grpc/xds/internal"
|
||||||
|
basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
|
lrsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
||||||
|
lrspb "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type lrsServer struct {
|
type lrsServer struct {
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package xds
|
package balancer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@ -27,18 +27,19 @@ import (
|
|||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
discoverypb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery"
|
|
||||||
edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
|
|
||||||
"google.golang.org/grpc/balancer/xds/lrs"
|
|
||||||
"google.golang.org/grpc/connectivity"
|
"google.golang.org/grpc/connectivity"
|
||||||
"google.golang.org/grpc/internal/grpctest"
|
"google.golang.org/grpc/internal/grpctest"
|
||||||
"google.golang.org/grpc/internal/leakcheck"
|
"google.golang.org/grpc/internal/leakcheck"
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
|
"google.golang.org/grpc/xds/internal/balancer/lrs"
|
||||||
|
discoverypb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery"
|
||||||
|
edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds"
|
||||||
)
|
)
|
||||||
|
|
||||||
var lbABuilder = &balancerABuilder{}
|
var lbABuilder = &balancerABuilder{}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
balancer.Register(&xdsBalancerBuilder{})
|
||||||
balancer.Register(lbABuilder)
|
balancer.Register(lbABuilder)
|
||||||
balancer.Register(&balancerBBuilder{})
|
balancer.Register(&balancerBBuilder{})
|
||||||
}
|
}
|
@ -20,7 +20,7 @@ package internal
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Locality is xds.Locality without XXX fields, so it can be used as map
|
// Locality is xds.Locality without XXX fields, so it can be used as map
|
@ -24,7 +24,7 @@ import (
|
|||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ignorePrefix = "XXX_"
|
const ignorePrefix = "XXX_"
|
@ -7,9 +7,9 @@ import proto "github.com/golang/protobuf/proto"
|
|||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
import config_source "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/config_source"
|
import config_source "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/config_source"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -11,18 +11,18 @@ import duration "github.com/golang/protobuf/ptypes/duration"
|
|||||||
import _struct "github.com/golang/protobuf/ptypes/struct"
|
import _struct "github.com/golang/protobuf/ptypes/struct"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import _ "google.golang.org/genproto/googleapis/api/annotations"
|
import _ "google.golang.org/genproto/googleapis/api/annotations"
|
||||||
import cert "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/auth/cert"
|
import cert "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/auth/cert"
|
||||||
import circuit_breaker "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker"
|
import circuit_breaker "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker"
|
||||||
import outlier_detection "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cluster/outlier_detection"
|
import outlier_detection "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cluster/outlier_detection"
|
||||||
import address "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address"
|
import address "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
import config_source "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/config_source"
|
import config_source "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/config_source"
|
||||||
import health_check "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/health_check"
|
import health_check "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/health_check"
|
||||||
import protocol "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/protocol"
|
import protocol "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/protocol"
|
||||||
import discovery "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery"
|
import discovery "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery"
|
||||||
import eds "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
|
import eds "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds"
|
||||||
import percent "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent"
|
import percent "google.golang.org/grpc/xds/internal/proto/envoy/type/percent"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "golang.org/x/net/context"
|
context "golang.org/x/net/context"
|
@ -7,7 +7,7 @@ import proto "github.com/golang/protobuf/proto"
|
|||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -8,7 +8,7 @@ import fmt "fmt"
|
|||||||
import math "math"
|
import math "math"
|
||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -7,8 +7,8 @@ import proto "github.com/golang/protobuf/proto"
|
|||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// source: envoy/api/v2/core/base.proto
|
// source: envoy/api/v2/core/base.proto
|
||||||
|
|
||||||
package core
|
package envoy_api_v2_core
|
||||||
|
|
||||||
import proto "github.com/golang/protobuf/proto"
|
import proto "github.com/golang/protobuf/proto"
|
||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
@ -9,8 +9,8 @@ import math "math"
|
|||||||
import any "github.com/golang/protobuf/ptypes/any"
|
import any "github.com/golang/protobuf/ptypes/any"
|
||||||
import _struct "github.com/golang/protobuf/ptypes/struct"
|
import _struct "github.com/golang/protobuf/ptypes/struct"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import percent "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent"
|
import percent "google.golang.org/grpc/xds/internal/proto/envoy/type/percent"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -8,8 +8,8 @@ import fmt "fmt"
|
|||||||
import math "math"
|
import math "math"
|
||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import grpc_service "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/grpc_service"
|
import grpc_service "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/grpc_service"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -10,8 +10,8 @@ import any "github.com/golang/protobuf/ptypes/any"
|
|||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import empty "github.com/golang/protobuf/ptypes/empty"
|
import empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
import _struct "github.com/golang/protobuf/ptypes/struct"
|
import _struct "github.com/golang/protobuf/ptypes/struct"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -10,9 +10,9 @@ import any "github.com/golang/protobuf/ptypes/any"
|
|||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import _struct "github.com/golang/protobuf/ptypes/struct"
|
import _struct "github.com/golang/protobuf/ptypes/struct"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
import _range "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/range"
|
import _range "google.golang.org/grpc/xds/internal/proto/envoy/type/range"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -8,7 +8,7 @@ import fmt "fmt"
|
|||||||
import math "math"
|
import math "math"
|
||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -8,7 +8,7 @@ import fmt "fmt"
|
|||||||
import math "math"
|
import math "math"
|
||||||
import any "github.com/golang/protobuf/ptypes/any"
|
import any "github.com/golang/protobuf/ptypes/any"
|
||||||
import status "google.golang.org/genproto/googleapis/rpc/status"
|
import status "google.golang.org/genproto/googleapis/rpc/status"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -9,10 +9,10 @@ import math "math"
|
|||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import _ "google.golang.org/genproto/googleapis/api/annotations"
|
import _ "google.golang.org/genproto/googleapis/api/annotations"
|
||||||
import discovery "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery"
|
import discovery "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery"
|
||||||
import endpoint "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
|
import endpoint "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
|
||||||
import percent "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent"
|
import percent "google.golang.org/grpc/xds/internal/proto/envoy/type/percent"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "golang.org/x/net/context"
|
context "golang.org/x/net/context"
|
@ -7,10 +7,10 @@ import proto "github.com/golang/protobuf/proto"
|
|||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
import address "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address"
|
import address "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
import health_check "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/health_check"
|
import health_check "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/health_check"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -8,9 +8,9 @@ import fmt "fmt"
|
|||||||
import math "math"
|
import math "math"
|
||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import _struct "github.com/golang/protobuf/ptypes/struct"
|
import _struct "github.com/golang/protobuf/ptypes/struct"
|
||||||
import address "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address"
|
import address "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -6,7 +6,7 @@ package v2
|
|||||||
import proto "github.com/golang/protobuf/proto"
|
import proto "github.com/golang/protobuf/proto"
|
||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import discovery "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery"
|
import discovery "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "golang.org/x/net/context"
|
context "golang.org/x/net/context"
|
@ -7,9 +7,9 @@ import proto "github.com/golang/protobuf/proto"
|
|||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
|
import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base"
|
||||||
import load_report "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report"
|
import load_report "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/load_report"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "golang.org/x/net/context"
|
context "golang.org/x/net/context"
|
@ -6,7 +6,7 @@ package envoy_type
|
|||||||
import proto "github.com/golang/protobuf/proto"
|
import proto "github.com/golang/protobuf/proto"
|
||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -6,7 +6,7 @@ package v1
|
|||||||
import proto "github.com/golang/protobuf/proto"
|
import proto "github.com/golang/protobuf/proto"
|
||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
@ -7,8 +7,8 @@ import proto "github.com/golang/protobuf/proto"
|
|||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||||
import orca_load_report "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
import orca_load_report "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report"
|
||||||
import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
import _ "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "golang.org/x/net/context"
|
context "golang.org/x/net/context"
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// source: validate/validate.proto
|
// source: validate/validate.proto
|
||||||
|
|
||||||
package validate // import "google.golang.org/grpc/balancer/xds/internal/proto/validate"
|
package validate // import "google.golang.org/grpc/xds/internal/proto/validate"
|
||||||
|
|
||||||
import proto "github.com/golang/protobuf/proto"
|
import proto "github.com/golang/protobuf/proto"
|
||||||
import fmt "fmt"
|
import fmt "fmt"
|
@ -1,7 +1,7 @@
|
|||||||
## Generate new pb.go files
|
## Generate new pb.go files
|
||||||
|
|
||||||
1. Update
|
1. Update
|
||||||
[DATA_PLANE_API_VERSION](https://github.com/grpc/grpc-go/blob/master/balancer/xds/internal/regenerate_scripts/envoy-proto-gen.sh#L3)
|
[DATA_PLANE_API_VERSION](https://github.com/grpc/grpc-go/blob/master/xds/internal/regenerate_scripts/envoy-proto-gen.sh#L3)
|
||||||
to a new commit for
|
to a new commit for
|
||||||
[envoyproxy/data-plane-api](https://github.com/envoyproxy/data-plane-api/commits/master).
|
[envoyproxy/data-plane-api](https://github.com/envoyproxy/data-plane-api/commits/master).
|
||||||
1. Run `./envoy-proto-gen.sh` in __this__ directory (and fingers crossed).
|
1. Run `./envoy-proto-gen.sh` in __this__ directory (and fingers crossed).
|
@ -27,6 +27,6 @@ cd ../data-plane-api
|
|||||||
|
|
||||||
git apply ../utils/data-plane-api.patch
|
git apply ../utils/data-plane-api.patch
|
||||||
# proto-gen.sh build all packages required for grpc xds implementation and move
|
# proto-gen.sh build all packages required for grpc xds implementation and move
|
||||||
# proto generated code to grpc/balancer/xds/internal/proto subdirectory.
|
# proto generated code to grpc/xds/internal/proto subdirectory.
|
||||||
../utils/proto-gen.sh
|
../utils/proto-gen.sh
|
||||||
|
|
@ -7,7 +7,7 @@ index c68ccbd..e6cc8cb 100644
|
|||||||
_GO_PROTO_SUFFIX = "_go_proto"
|
_GO_PROTO_SUFFIX = "_go_proto"
|
||||||
_GO_GRPC_SUFFIX = "_go_grpc"
|
_GO_GRPC_SUFFIX = "_go_grpc"
|
||||||
-_GO_IMPORTPATH_PREFIX = "github.com/envoyproxy/data-plane-api/api/"
|
-_GO_IMPORTPATH_PREFIX = "github.com/envoyproxy/data-plane-api/api/"
|
||||||
+_GO_IMPORTPATH_PREFIX = "google.golang.org/grpc/balancer/xds/internal/proto/"
|
+_GO_IMPORTPATH_PREFIX = "google.golang.org/grpc/xds/internal/proto/"
|
||||||
|
|
||||||
def _Suffix(d, suffix):
|
def _Suffix(d, suffix):
|
||||||
return d + suffix
|
return d + suffix
|
@ -7,7 +7,7 @@ index 8a3d063..939d997 100644
|
|||||||
go_proto_library(
|
go_proto_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
- importpath = "github.com/envoyproxy/protoc-gen-validate/validate",
|
- importpath = "github.com/envoyproxy/protoc-gen-validate/validate",
|
||||||
+ importpath = "google.golang.org/grpc/balancer/xds/internal/proto/validate",
|
+ importpath = "google.golang.org/grpc/xds/internal/proto/validate",
|
||||||
proto = ":validate_proto",
|
proto = ":validate_proto",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
@ -20,7 +20,7 @@ index 864ad86..6165f39 100644
|
|||||||
package validate;
|
package validate;
|
||||||
|
|
||||||
-option go_package = "github.com/envoyproxy/protoc-gen-validate/validate";
|
-option go_package = "github.com/envoyproxy/protoc-gen-validate/validate";
|
||||||
+option go_package = "google.golang.org/grpc/balancer/xds/internal/proto/validate";
|
+option go_package = "google.golang.org/grpc/xds/internal/proto/validate";
|
||||||
option java_package = "io.envoyproxy.pgv.validate";
|
option java_package = "io.envoyproxy.pgv.validate";
|
||||||
|
|
||||||
import "google/protobuf/descriptor.proto";
|
import "google/protobuf/descriptor.proto";
|
Reference in New Issue
Block a user