mirror of https://github.com/grpc/grpc-go.git
testing: update Go to 1.19 (#5717)
This commit is contained in:
parent
eb8aa3192b
commit
778860e606
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.19
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
|
@ -44,31 +44,31 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- type: vet+tests
|
- type: vet+tests
|
||||||
goversion: 1.18
|
goversion: 1.19
|
||||||
|
|
||||||
- type: tests
|
- type: tests
|
||||||
goversion: 1.18
|
goversion: 1.19
|
||||||
testflags: -race
|
testflags: -race
|
||||||
|
|
||||||
- type: tests
|
- type: tests
|
||||||
goversion: 1.18
|
goversion: 1.19
|
||||||
goarch: 386
|
goarch: 386
|
||||||
|
|
||||||
- type: tests
|
- type: tests
|
||||||
goversion: 1.18
|
goversion: 1.19
|
||||||
goarch: arm64
|
goarch: arm64
|
||||||
|
|
||||||
|
- type: tests
|
||||||
|
goversion: 1.18
|
||||||
|
|
||||||
- type: tests
|
- type: tests
|
||||||
goversion: 1.17
|
goversion: 1.17
|
||||||
|
|
||||||
- type: tests
|
- type: tests
|
||||||
goversion: 1.16
|
goversion: 1.16
|
||||||
|
|
||||||
- type: tests
|
|
||||||
goversion: 1.15
|
|
||||||
|
|
||||||
- type: extras
|
- type: extras
|
||||||
goversion: 1.18
|
goversion: 1.19
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Setup the environment.
|
# Setup the environment.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
//
|
//
|
||||||
// - CSDS: https://github.com/grpc/proposal/blob/master/A40-csds-support.md
|
// - CSDS: https://github.com/grpc/proposal/blob/master/A40-csds-support.md
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: All APIs in this package are experimental and may be removed in a
|
// Notice: All APIs in this package are experimental and may be removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package attributes defines a generic key/value store used in various gRPC
|
// Package attributes defines a generic key/value store used in various gRPC
|
||||||
// components.
|
// components.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
// Package authz exposes methods to manage authorization within gRPC.
|
// Package authz exposes methods to manage authorization within gRPC.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed
|
// Notice: This package is EXPERIMENTAL and may be changed or removed
|
||||||
// in a later release.
|
// in a later release.
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ type BackoffConfig struct {
|
||||||
// here for more details:
|
// here for more details:
|
||||||
// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md.
|
// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ type LoadBalanceRequest struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to LoadBalanceRequestType:
|
// Types that are assignable to LoadBalanceRequestType:
|
||||||
|
//
|
||||||
// *LoadBalanceRequest_InitialRequest
|
// *LoadBalanceRequest_InitialRequest
|
||||||
// *LoadBalanceRequest_ClientStats
|
// *LoadBalanceRequest_ClientStats
|
||||||
LoadBalanceRequestType isLoadBalanceRequest_LoadBalanceRequestType `protobuf_oneof:"load_balance_request_type"`
|
LoadBalanceRequestType isLoadBalanceRequest_LoadBalanceRequestType `protobuf_oneof:"load_balance_request_type"`
|
||||||
|
|
@ -340,6 +341,7 @@ type LoadBalanceResponse struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to LoadBalanceResponseType:
|
// Types that are assignable to LoadBalanceResponseType:
|
||||||
|
//
|
||||||
// *LoadBalanceResponse_InitialResponse
|
// *LoadBalanceResponse_InitialResponse
|
||||||
// *LoadBalanceResponse_ServerList
|
// *LoadBalanceResponse_ServerList
|
||||||
// *LoadBalanceResponse_FallbackResponse
|
// *LoadBalanceResponse_FallbackResponse
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
// Package grpclb defines a grpclb balancer.
|
// Package grpclb defines a grpclb balancer.
|
||||||
//
|
//
|
||||||
// To install grpclb balancer, import this package as:
|
// To install grpclb balancer, import this package as:
|
||||||
|
//
|
||||||
// import _ "google.golang.org/grpc/balancer/grpclb"
|
// import _ "google.golang.org/grpc/balancer/grpclb"
|
||||||
package grpclb
|
package grpclb
|
||||||
|
|
||||||
|
|
@ -231,6 +232,7 @@ type lbBalancer struct {
|
||||||
// it. The picker
|
// it. The picker
|
||||||
// - always returns ErrTransientFailure if the balancer is in TransientFailure,
|
// - always returns ErrTransientFailure if the balancer is in TransientFailure,
|
||||||
// - does two layer roundrobin pick otherwise.
|
// - does two layer roundrobin pick otherwise.
|
||||||
|
//
|
||||||
// Caller must hold lb.mu.
|
// Caller must hold lb.mu.
|
||||||
func (lb *lbBalancer) regeneratePicker(resetDrop bool) {
|
func (lb *lbBalancer) regeneratePicker(resetDrop bool) {
|
||||||
if lb.state == connectivity.TransientFailure {
|
if lb.state == connectivity.TransientFailure {
|
||||||
|
|
|
||||||
|
|
@ -426,7 +426,6 @@ func (b *rlsBalancer) ExitIdle() {
|
||||||
|
|
||||||
// sendNewPickerLocked pushes a new picker on to the channel.
|
// sendNewPickerLocked pushes a new picker on to the channel.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// Note that regardless of what connectivity state is reported, the policy will
|
// Note that regardless of what connectivity state is reported, the policy will
|
||||||
// return its own picker, and not a picker that unconditionally queues
|
// return its own picker, and not a picker that unconditionally queues
|
||||||
// (typically used for IDLE or CONNECTING) or a picker that unconditionally
|
// (typically used for IDLE or CONNECTING) or a picker that unconditionally
|
||||||
|
|
|
||||||
|
|
@ -134,10 +134,13 @@ type lbConfigJSON struct {
|
||||||
// - ignore `valid_targets` field
|
// - ignore `valid_targets` field
|
||||||
// - `cache_size_bytes` field must have a value greater than 0, and if its
|
// - `cache_size_bytes` field must have a value greater than 0, and if its
|
||||||
// value is greater than 5M, we cap it at 5M
|
// value is greater than 5M, we cap it at 5M
|
||||||
|
//
|
||||||
// - routeLookupChannelServiceConfig:
|
// - routeLookupChannelServiceConfig:
|
||||||
// - if specified, must parse as valid service config
|
// - if specified, must parse as valid service config
|
||||||
|
//
|
||||||
// - childPolicy:
|
// - childPolicy:
|
||||||
// - must find a valid child policy with a valid config
|
// - must find a valid child policy with a valid config
|
||||||
|
//
|
||||||
// - childPolicyConfigTargetFieldName:
|
// - childPolicyConfigTargetFieldName:
|
||||||
// - must be set and non-empty
|
// - must be set and non-empty
|
||||||
func (rlsBB) ParseConfig(c json.RawMessage) (serviceconfig.LoadBalancingConfig, error) {
|
func (rlsBB) ParseConfig(c json.RawMessage) (serviceconfig.LoadBalancingConfig, error) {
|
||||||
|
|
|
||||||
|
|
@ -45,17 +45,17 @@ const (
|
||||||
// The throttler has the following knobs for which we will use defaults for
|
// The throttler has the following knobs for which we will use defaults for
|
||||||
// now. If there is a need to make them configurable at a later point in time,
|
// now. If there is a need to make them configurable at a later point in time,
|
||||||
// support for the same will be added.
|
// support for the same will be added.
|
||||||
// * Duration: amount of recent history that will be taken into account for
|
// - Duration: amount of recent history that will be taken into account for
|
||||||
// making client-side throttling decisions. A default of 30 seconds is used.
|
// making client-side throttling decisions. A default of 30 seconds is used.
|
||||||
// * Bins: number of bins to be used for bucketing historical data. A default
|
// - Bins: number of bins to be used for bucketing historical data. A default
|
||||||
// of 100 is used.
|
// of 100 is used.
|
||||||
// * RatioForAccepts: ratio by which accepts are multiplied, typically a value
|
// - RatioForAccepts: ratio by which accepts are multiplied, typically a value
|
||||||
// slightly larger than 1.0. This is used to make the throttler behave as if
|
// slightly larger than 1.0. This is used to make the throttler behave as if
|
||||||
// the backend had accepted more requests than it actually has, which lets us
|
// the backend had accepted more requests than it actually has, which lets us
|
||||||
// err on the side of sending to the backend more requests than we think it
|
// err on the side of sending to the backend more requests than we think it
|
||||||
// will accept for the sake of speeding up the propagation of state. A
|
// will accept for the sake of speeding up the propagation of state. A
|
||||||
// default of 2.0 is used.
|
// default of 2.0 is used.
|
||||||
// * RequestsPadding: is used to decrease the (client-side) throttling
|
// - RequestsPadding: is used to decrease the (client-side) throttling
|
||||||
// probability in the low QPS regime (to speed up propagation of state), as
|
// probability in the low QPS regime (to speed up propagation of state), as
|
||||||
// well as to safeguard against hitting a client-side throttling probability
|
// well as to safeguard against hitting a client-side throttling probability
|
||||||
// of 100%. The weight of this value decreases as the number of requests in
|
// of 100%. The weight of this value decreases as the number of requests in
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ func (a AddrInfo) Equal(o interface{}) bool {
|
||||||
// SetAddrInfo returns a copy of addr in which the BalancerAttributes field is
|
// SetAddrInfo returns a copy of addr in which the BalancerAttributes field is
|
||||||
// updated with addrInfo.
|
// updated with addrInfo.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -57,7 +57,7 @@ func SetAddrInfo(addr resolver.Address, addrInfo AddrInfo) resolver.Address {
|
||||||
// GetAddrInfo returns the AddrInfo stored in the BalancerAttributes field of
|
// GetAddrInfo returns the AddrInfo stored in the BalancerAttributes field of
|
||||||
// addr.
|
// addr.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ work, you can get the benchmark result and compare it with the base anytime.
|
||||||
|
|
||||||
Assume there are two result files names as "basePerf" and "curPerf" created by adding
|
Assume there are two result files names as "basePerf" and "curPerf" created by adding
|
||||||
-resultFile=basePerf and -resultFile=curPerf.
|
-resultFile=basePerf and -resultFile=curPerf.
|
||||||
|
|
||||||
To format the curPerf, run:
|
To format the curPerf, run:
|
||||||
go run benchmark/benchresult/main.go curPerf
|
go run benchmark/benchresult/main.go curPerf
|
||||||
To observe how the performance changes based on a base result, run:
|
To observe how the performance changes based on a base result, run:
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,14 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
To format the benchmark result:
|
To format the benchmark result:
|
||||||
|
|
||||||
go run benchmark/benchresult/main.go resultfile
|
go run benchmark/benchresult/main.go resultfile
|
||||||
|
|
||||||
To see the performance change based on a old result:
|
To see the performance change based on a old result:
|
||||||
go run benchmark/benchresult/main.go resultfile_old resultfile
|
|
||||||
It will print the comparison result of intersection benchmarks between two files.
|
|
||||||
|
|
||||||
|
go run benchmark/benchresult/main.go resultfile_old resultfile
|
||||||
|
|
||||||
|
It will print the comparison result of intersection benchmarks between two files.
|
||||||
*/
|
*/
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
Package main provides a server used for benchmarking. It launches a server
|
Package main provides a server used for benchmarking. It launches a server
|
||||||
which is listening on port 50051. An example to start the server can be found
|
which is listening on port 50051. An example to start the server can be found
|
||||||
at:
|
at:
|
||||||
|
|
||||||
go run benchmark/server/main.go -test_name=grpc_test
|
go run benchmark/server/main.go -test_name=grpc_test
|
||||||
|
|
||||||
After starting the server, the client can be run separately and used to test
|
After starting the server, the client can be run separately and used to test
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,7 @@ type GrpcLogEntry struct {
|
||||||
// according to the type of the log entry.
|
// according to the type of the log entry.
|
||||||
//
|
//
|
||||||
// Types that are assignable to Payload:
|
// Types that are assignable to Payload:
|
||||||
|
//
|
||||||
// *GrpcLogEntry_ClientHeader
|
// *GrpcLogEntry_ClientHeader
|
||||||
// *GrpcLogEntry_ServerHeader
|
// *GrpcLogEntry_ServerHeader
|
||||||
// *GrpcLogEntry_Message
|
// *GrpcLogEntry_Message
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
// https://github.com/grpc/proposal/blob/master/A14-channelz.md, is provided by
|
// https://github.com/grpc/proposal/blob/master/A14-channelz.md, is provided by
|
||||||
// the `internal/channelz` package.
|
// the `internal/channelz` package.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: All APIs in this package are experimental and may be removed in a
|
// Notice: All APIs in this package are experimental and may be removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -514,6 +514,7 @@ type ChannelTraceEvent struct {
|
||||||
// created.
|
// created.
|
||||||
//
|
//
|
||||||
// Types that are assignable to ChildRef:
|
// Types that are assignable to ChildRef:
|
||||||
|
//
|
||||||
// *ChannelTraceEvent_ChannelRef
|
// *ChannelTraceEvent_ChannelRef
|
||||||
// *ChannelTraceEvent_SubchannelRef
|
// *ChannelTraceEvent_SubchannelRef
|
||||||
ChildRef isChannelTraceEvent_ChildRef `protobuf_oneof:"child_ref"`
|
ChildRef isChannelTraceEvent_ChildRef `protobuf_oneof:"child_ref"`
|
||||||
|
|
@ -1338,6 +1339,7 @@ type Address struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to Address:
|
// Types that are assignable to Address:
|
||||||
|
//
|
||||||
// *Address_TcpipAddress
|
// *Address_TcpipAddress
|
||||||
// *Address_UdsAddress_
|
// *Address_UdsAddress_
|
||||||
// *Address_OtherAddress_
|
// *Address_OtherAddress_
|
||||||
|
|
@ -1433,6 +1435,7 @@ type Security struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to Model:
|
// Types that are assignable to Model:
|
||||||
|
//
|
||||||
// *Security_Tls_
|
// *Security_Tls_
|
||||||
// *Security_Other
|
// *Security_Other
|
||||||
Model isSecurity_Model `protobuf_oneof:"model"`
|
Model isSecurity_Model `protobuf_oneof:"model"`
|
||||||
|
|
@ -2908,6 +2911,7 @@ type Security_Tls struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to CipherSuite:
|
// Types that are assignable to CipherSuite:
|
||||||
|
//
|
||||||
// *Security_Tls_StandardName
|
// *Security_Tls_StandardName
|
||||||
// *Security_Tls_OtherName
|
// *Security_Tls_OtherName
|
||||||
CipherSuite isSecurity_Tls_CipherSuite `protobuf_oneof:"cipher_suite"`
|
CipherSuite isSecurity_Tls_CipherSuite `protobuf_oneof:"cipher_suite"`
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,7 @@ type ClientConn struct {
|
||||||
// WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or
|
// WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or
|
||||||
// ctx expires. A true value is returned in former case and false in latter.
|
// ctx expires. A true value is returned in former case and false in latter.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -522,7 +522,7 @@ func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connec
|
||||||
|
|
||||||
// GetState returns the connectivity.State of ClientConn.
|
// GetState returns the connectivity.State of ClientConn.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later
|
||||||
// release.
|
// release.
|
||||||
|
|
@ -534,7 +534,7 @@ func (cc *ClientConn) GetState() connectivity.State {
|
||||||
// the channel is idle. Does not wait for the connection attempts to begin
|
// the channel is idle. Does not wait for the connection attempts to begin
|
||||||
// before returning.
|
// before returning.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later
|
||||||
// release.
|
// release.
|
||||||
|
|
@ -761,7 +761,7 @@ func (cc *ClientConn) channelzMetric() *channelz.ChannelInternalMetric {
|
||||||
|
|
||||||
// Target returns the target string of the ClientConn.
|
// Target returns the target string of the ClientConn.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -998,7 +998,7 @@ func (cc *ClientConn) resolveNow(o resolver.ResolveNowOptions) {
|
||||||
// However, if a previously unavailable network becomes available, this may be
|
// However, if a previously unavailable network becomes available, this may be
|
||||||
// used to trigger an immediate reconnect.
|
// used to trigger an immediate reconnect.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,17 @@
|
||||||
// protoc-gen-go-grpc is a plugin for the Google protocol buffer compiler to
|
// protoc-gen-go-grpc is a plugin for the Google protocol buffer compiler to
|
||||||
// generate Go code. Install it by building this program and making it
|
// generate Go code. Install it by building this program and making it
|
||||||
// accessible within your PATH with the name:
|
// accessible within your PATH with the name:
|
||||||
|
//
|
||||||
// protoc-gen-go-grpc
|
// protoc-gen-go-grpc
|
||||||
//
|
//
|
||||||
// The 'go-grpc' suffix becomes part of the argument for the protocol compiler,
|
// The 'go-grpc' suffix becomes part of the argument for the protocol compiler,
|
||||||
// such that it can be invoked as:
|
// such that it can be invoked as:
|
||||||
|
//
|
||||||
// protoc --go-grpc_out=. path/to/file.proto
|
// protoc --go-grpc_out=. path/to/file.proto
|
||||||
//
|
//
|
||||||
// This generates Go service definitions for the protocol buffer defined by
|
// This generates Go service definitions for the protocol buffer defined by
|
||||||
// file.proto. With that input, the output will be written to:
|
// file.proto. With that input, the output will be written to:
|
||||||
|
//
|
||||||
// path/to/file_grpc.pb.go
|
// path/to/file_grpc.pb.go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,7 @@ type Identity struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to IdentityOneof:
|
// Types that are assignable to IdentityOneof:
|
||||||
|
//
|
||||||
// *Identity_ServiceAccount
|
// *Identity_ServiceAccount
|
||||||
// *Identity_Hostname
|
// *Identity_Hostname
|
||||||
IdentityOneof isIdentity_IdentityOneof `protobuf_oneof:"identity_oneof"`
|
IdentityOneof isIdentity_IdentityOneof `protobuf_oneof:"identity_oneof"`
|
||||||
|
|
@ -664,6 +665,7 @@ type HandshakerReq struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to ReqOneof:
|
// Types that are assignable to ReqOneof:
|
||||||
|
//
|
||||||
// *HandshakerReq_ClientStart
|
// *HandshakerReq_ClientStart
|
||||||
// *HandshakerReq_ServerStart
|
// *HandshakerReq_ServerStart
|
||||||
// *HandshakerReq_Next
|
// *HandshakerReq_Next
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ const cfeClusterAuthorityName = "traffic-director-c2p.xds.googleapis.com"
|
||||||
// "xdstp://traffic-director-c2p.xds.googleapis.com/envoy.config.cluster.v3.Cluster/google_cfe_",
|
// "xdstp://traffic-director-c2p.xds.googleapis.com/envoy.config.cluster.v3.Cluster/google_cfe_",
|
||||||
// use TLS
|
// use TLS
|
||||||
// - otherwise, use ALTS
|
// - otherwise, use ALTS
|
||||||
|
//
|
||||||
// - else, do TLS
|
// - else, do TLS
|
||||||
//
|
//
|
||||||
// On the server, ServerHandshake always does TLS.
|
// On the server, ServerHandshake always does TLS.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
// reported. If local credentials is not used in local connections
|
// reported. If local credentials is not used in local connections
|
||||||
// (local TCP or UDS), it will fail.
|
// (local TCP or UDS), it will fail.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package sts implements call credentials using STS (Security Token Service) as
|
// Package sts implements call credentials using STS (Security Token Service) as
|
||||||
// defined in https://tools.ietf.org/html/rfc8693.
|
// defined in https://tools.ietf.org/html/rfc8693.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: All APIs in this package are experimental and may be changed or
|
// Notice: All APIs in this package are experimental and may be changed or
|
||||||
// removed in a later release.
|
// removed in a later release.
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error
|
||||||
// TLSChannelzSecurityValue defines the struct that TLS protocol should return
|
// TLSChannelzSecurityValue defines the struct that TLS protocol should return
|
||||||
// from GetSecurityValue(), containing security info like cipher and certificate used.
|
// from GetSecurityValue(), containing security info like cipher and certificate used.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package pemfile provides a file watching certificate provider plugin
|
// Package pemfile provides a file watching certificate provider plugin
|
||||||
// implementation which works for files with PEM contents.
|
// implementation which works for files with PEM contents.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: All APIs in this package are experimental and may be removed in a
|
// Notice: All APIs in this package are experimental and may be removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
// Package certprovider defines APIs for Certificate Providers in gRPC.
|
// Package certprovider defines APIs for Certificate Providers in gRPC.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: All APIs in this package are experimental and may be removed in a
|
// Notice: All APIs in this package are experimental and may be removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package encoding defines the interface for the compressor and codec, and
|
// Package encoding defines the interface for the compressor and codec, and
|
||||||
// functions to register and retrieve compressors and codecs.
|
// functions to register and retrieve compressors and codecs.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package gzip implements and registers the gzip compressor
|
// Package gzip implements and registers the gzip compressor
|
||||||
// during the initialization.
|
// during the initialization.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package observability implements the tracing, metrics, and logging data
|
// Package observability implements the tracing, metrics, and logging data
|
||||||
// collection, and provides controlling knobs via a config file.
|
// collection, and provides controlling knobs via a config file.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ func (g *loggerT) V(l int) bool {
|
||||||
// DepthLoggerV2, the below functions will be called with the appropriate stack
|
// DepthLoggerV2, the below functions will be called with the appropriate stack
|
||||||
// depth set for trivial functions the logger may ignore.
|
// depth set for trivial functions the logger may ignore.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ func TestLoggerV2Severity(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if b is in the format of:
|
// check if b is in the format of:
|
||||||
|
//
|
||||||
// 2017/04/07 14:55:42 WARNING: WARNING
|
// 2017/04/07 14:55:42 WARNING: WARNING
|
||||||
func checkLogForSeverity(s int, b []byte) error {
|
func checkLogForSeverity(s int, b []byte) error {
|
||||||
expected := regexp.MustCompile(fmt.Sprintf(`^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} %s: %s\n$`, severityName[s], severityName[s]))
|
expected := regexp.MustCompile(fmt.Sprintf(`^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} %s: %s\n$`, severityName[s], severityName[s]))
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,7 @@ func (s) TestBalancerGroup_start_close(t *testing.T) {
|
||||||
// The potential deadlock can happen if we
|
// The potential deadlock can happen if we
|
||||||
// - hold a lock and send updates to balancer (e.g. update resolved addresses)
|
// - hold a lock and send updates to balancer (e.g. update resolved addresses)
|
||||||
// - the balancer calls back (NewSubConn or update picker) in line
|
// - the balancer calls back (NewSubConn or update picker) in line
|
||||||
|
//
|
||||||
// The callback will try to hold hte same lock again, which will cause a
|
// The callback will try to hold hte same lock again, which will cause a
|
||||||
// deadlock.
|
// deadlock.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ type LoggerV2 interface {
|
||||||
// This is a copy of the DepthLoggerV2 defined in the external grpclog package.
|
// This is a copy of the DepthLoggerV2 defined in the external grpclog package.
|
||||||
// It is defined here to avoid a circular dependency.
|
// It is defined here to avoid a circular dependency.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,11 @@ func getTestFunc(t *testing.T, xv reflect.Value, name string) func(*testing.T) {
|
||||||
// functions, respectively.
|
// functions, respectively.
|
||||||
//
|
//
|
||||||
// For example usage, see example_test.go. Run it using:
|
// For example usage, see example_test.go. Run it using:
|
||||||
|
//
|
||||||
// $ go test -v -run TestExample .
|
// $ go test -v -run TestExample .
|
||||||
//
|
//
|
||||||
// To run a specific test/subtest:
|
// To run a specific test/subtest:
|
||||||
|
//
|
||||||
// $ go test -v -run 'TestExample/^Something$' .
|
// $ go test -v -run 'TestExample/^Something$' .
|
||||||
func RunSubTests(t *testing.T, x interface{}) {
|
func RunSubTests(t *testing.T, x interface{}) {
|
||||||
xt := reflect.TypeOf(x)
|
xt := reflect.TypeOf(x)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ import (
|
||||||
|
|
||||||
// ParseMethod splits service and method from the input. It expects format
|
// ParseMethod splits service and method from the input. It expects format
|
||||||
// "/service/method".
|
// "/service/method".
|
||||||
//
|
|
||||||
func ParseMethod(methodName string) (service, method string, _ error) {
|
func ParseMethod(methodName string) (service, method string, _ error) {
|
||||||
if !strings.HasPrefix(methodName, "/") {
|
if !strings.HasPrefix(methodName, "/") {
|
||||||
return "", "", errors.New("invalid method name: should start with /")
|
return "", "", errors.New("invalid method name: should start with /")
|
||||||
|
|
|
||||||
|
|
@ -70,16 +70,19 @@ func Set(addr resolver.Address, path []string) resolver.Address {
|
||||||
//
|
//
|
||||||
// Input:
|
// Input:
|
||||||
// [
|
// [
|
||||||
|
//
|
||||||
// {addr0, path: [p0, wt0]}
|
// {addr0, path: [p0, wt0]}
|
||||||
// {addr1, path: [p0, wt1]}
|
// {addr1, path: [p0, wt1]}
|
||||||
// {addr2, path: [p1, wt2]}
|
// {addr2, path: [p1, wt2]}
|
||||||
// {addr3, path: [p1, wt3]}
|
// {addr3, path: [p1, wt3]}
|
||||||
|
//
|
||||||
// ]
|
// ]
|
||||||
//
|
//
|
||||||
// Addresses will be split into p0/p1, and the p0/p1 will be removed from the
|
// Addresses will be split into p0/p1, and the p0/p1 will be removed from the
|
||||||
// path.
|
// path.
|
||||||
//
|
//
|
||||||
// Output:
|
// Output:
|
||||||
|
//
|
||||||
// {
|
// {
|
||||||
// p0: [
|
// p0: [
|
||||||
// {addr0, path: [wt0]},
|
// {addr0, path: [wt0]},
|
||||||
|
|
|
||||||
|
|
@ -204,8 +204,10 @@ func (x *GrpcKeyBuilder) GetConstantKeys() map[string]string {
|
||||||
//
|
//
|
||||||
// For a service where the project id can be expressed either as a subdomain or
|
// For a service where the project id can be expressed either as a subdomain or
|
||||||
// in the path, separate HttpKeyBuilders must be used:
|
// in the path, separate HttpKeyBuilders must be used:
|
||||||
|
//
|
||||||
// host_pattern: 'example.com' path_pattern: '/{id}/{object}/**'
|
// host_pattern: 'example.com' path_pattern: '/{id}/{object}/**'
|
||||||
// host_pattern: '{id}.example.com' path_pattern: '/{object}/**'
|
// host_pattern: '{id}.example.com' path_pattern: '/{object}/**'
|
||||||
|
//
|
||||||
// If the host is exactly 'example.com', the first path segment will be used as
|
// If the host is exactly 'example.com', the first path segment will be used as
|
||||||
// the id and the second segment as the object. If the host has a subdomain, the
|
// the id and the second segment as the object. If the host has a subdomain, the
|
||||||
// subdomain will be used as the id and the first segment as the object. If
|
// subdomain will be used as the id and the first segment as the object. If
|
||||||
|
|
@ -244,6 +246,7 @@ type HttpKeyBuilder struct {
|
||||||
// - "{<name>=...}": One or more segment capture, where "..." can be any
|
// - "{<name>=...}": One or more segment capture, where "..." can be any
|
||||||
// template that does not include a capture.
|
// template that does not include a capture.
|
||||||
// - "{<name>}": A single segment capture. Identical to {<name>=*}.
|
// - "{<name>}": A single segment capture. Identical to {<name>=*}.
|
||||||
|
//
|
||||||
// A custom method may also be specified by appending ":" and the custom
|
// A custom method may also be specified by appending ":" and the custom
|
||||||
// method name or "*" to indicate any custom method (including no custom
|
// method name or "*" to indicate any custom method (including no custom
|
||||||
// method). For example, "/*/projects/{project_id}/**:*" extracts
|
// method). For example, "/*/projects/{project_id}/**:*" extracts
|
||||||
|
|
|
||||||
|
|
@ -442,10 +442,10 @@ func (ht *serverHandlerTransport) Drain() {
|
||||||
// mapRecvMsgError returns the non-nil err into the appropriate
|
// mapRecvMsgError returns the non-nil err into the appropriate
|
||||||
// error value as expected by callers of *grpc.parser.recvMsg.
|
// error value as expected by callers of *grpc.parser.recvMsg.
|
||||||
// In particular, in can only be:
|
// In particular, in can only be:
|
||||||
// * io.EOF
|
// - io.EOF
|
||||||
// * io.ErrUnexpectedEOF
|
// - io.ErrUnexpectedEOF
|
||||||
// * of type transport.ConnectionError
|
// - of type transport.ConnectionError
|
||||||
// * an error from the status package
|
// - an error from the status package
|
||||||
func mapRecvMsgError(err error) error {
|
func mapRecvMsgError(err error) error {
|
||||||
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -300,6 +300,7 @@ type LoadParams struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to Load:
|
// Types that are assignable to Load:
|
||||||
|
//
|
||||||
// *LoadParams_ClosedLoop
|
// *LoadParams_ClosedLoop
|
||||||
// *LoadParams_Poisson
|
// *LoadParams_Poisson
|
||||||
Load isLoadParams_Load `protobuf_oneof:"load"`
|
Load isLoadParams_Load `protobuf_oneof:"load"`
|
||||||
|
|
@ -445,6 +446,7 @@ type ChannelArg struct {
|
||||||
|
|
||||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
// Types that are assignable to Value:
|
// Types that are assignable to Value:
|
||||||
|
//
|
||||||
// *ChannelArg_StrValue
|
// *ChannelArg_StrValue
|
||||||
// *ChannelArg_IntValue
|
// *ChannelArg_IntValue
|
||||||
Value isChannelArg_Value `protobuf_oneof:"value"`
|
Value isChannelArg_Value `protobuf_oneof:"value"`
|
||||||
|
|
@ -834,6 +836,7 @@ type ClientArgs struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to Argtype:
|
// Types that are assignable to Argtype:
|
||||||
|
//
|
||||||
// *ClientArgs_Setup
|
// *ClientArgs_Setup
|
||||||
// *ClientArgs_Mark
|
// *ClientArgs_Mark
|
||||||
Argtype isClientArgs_Argtype `protobuf_oneof:"argtype"`
|
Argtype isClientArgs_Argtype `protobuf_oneof:"argtype"`
|
||||||
|
|
@ -1061,6 +1064,7 @@ type ServerArgs struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to Argtype:
|
// Types that are assignable to Argtype:
|
||||||
|
//
|
||||||
// *ServerArgs_Setup
|
// *ServerArgs_Setup
|
||||||
// *ServerArgs_Mark
|
// *ServerArgs_Mark
|
||||||
Argtype isServerArgs_Argtype `protobuf_oneof:"argtype"`
|
Argtype isServerArgs_Argtype `protobuf_oneof:"argtype"`
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,7 @@ type Metric struct {
|
||||||
|
|
||||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
// Types that are assignable to Value:
|
// Types that are assignable to Value:
|
||||||
|
//
|
||||||
// *Metric_Count
|
// *Metric_Count
|
||||||
// *Metric_Histogram
|
// *Metric_Histogram
|
||||||
Value isMetric_Value `protobuf_oneof:"value"`
|
Value isMetric_Value `protobuf_oneof:"value"`
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ const _ = proto.ProtoPackageIsVersion4
|
||||||
// service Foo {
|
// service Foo {
|
||||||
// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
|
// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
|
||||||
// };
|
// };
|
||||||
//
|
|
||||||
type Empty struct {
|
type Empty struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,7 @@ type PayloadConfig struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to Payload:
|
// Types that are assignable to Payload:
|
||||||
|
//
|
||||||
// *PayloadConfig_BytebufParams
|
// *PayloadConfig_BytebufParams
|
||||||
// *PayloadConfig_SimpleParams
|
// *PayloadConfig_SimpleParams
|
||||||
// *PayloadConfig_ComplexParams
|
// *PayloadConfig_ComplexParams
|
||||||
|
|
|
||||||
|
|
@ -340,6 +340,7 @@ type rpcConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseRPCMetadata turns EmptyCall:key1:value1 into
|
// parseRPCMetadata turns EmptyCall:key1:value1 into
|
||||||
|
//
|
||||||
// {typ: emptyCall, md: {key1:value1}}.
|
// {typ: emptyCall, md: {key1:value1}}.
|
||||||
func parseRPCMetadata(rpcMetadataStr string, rpcs []string) []*rpcConfig {
|
func parseRPCMetadata(rpcMetadataStr string, rpcs []string) []*rpcConfig {
|
||||||
rpcMetadataSplit := strings.Split(rpcMetadataStr, ",")
|
rpcMetadataSplit := strings.Split(rpcMetadataStr, ",")
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ type MD map[string][]string
|
||||||
// - uppercase letters: A-Z (normalized to lower)
|
// - uppercase letters: A-Z (normalized to lower)
|
||||||
// - lowercase letters: a-z
|
// - lowercase letters: a-z
|
||||||
// - special characters: -_.
|
// - special characters: -_.
|
||||||
|
//
|
||||||
// Uppercase letters are automatically converted to lowercase.
|
// Uppercase letters are automatically converted to lowercase.
|
||||||
//
|
//
|
||||||
// Keys beginning with "grpc-" are reserved for grpc-internal use only and may
|
// Keys beginning with "grpc-" are reserved for grpc-internal use only and may
|
||||||
|
|
@ -66,6 +67,7 @@ func New(m map[string]string) MD {
|
||||||
// - uppercase letters: A-Z (normalized to lower)
|
// - uppercase letters: A-Z (normalized to lower)
|
||||||
// - lowercase letters: a-z
|
// - lowercase letters: a-z
|
||||||
// - special characters: -_.
|
// - special characters: -_.
|
||||||
|
//
|
||||||
// Uppercase letters are automatically converted to lowercase.
|
// Uppercase letters are automatically converted to lowercase.
|
||||||
//
|
//
|
||||||
// Keys beginning with "grpc-" are reserved for grpc-internal use only and may
|
// Keys beginning with "grpc-" are reserved for grpc-internal use only and may
|
||||||
|
|
@ -196,7 +198,7 @@ func FromIncomingContext(ctx context.Context) (MD, bool) {
|
||||||
// ValueFromIncomingContext returns the metadata value corresponding to the metadata
|
// ValueFromIncomingContext returns the metadata value corresponding to the metadata
|
||||||
// key from the incoming metadata if it exists. Key must be lower-case.
|
// key from the incoming metadata if it exists. Key must be lower-case.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// Envoy) on the data plane. In a proxyless world with gRPC enabled
|
// Envoy) on the data plane. In a proxyless world with gRPC enabled
|
||||||
// applications, aggregation of such reports will be done by the gRPC client.
|
// applications, aggregation of such reports will be done by the gRPC client.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: All APIs is this package are EXPERIMENTAL and may be changed or
|
// Notice: All APIs is this package are EXPERIMENTAL and may be changed or
|
||||||
// removed in a later release.
|
// removed in a later release.
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
// PreparedMsg is responsible for creating a Marshalled and Compressed object.
|
// PreparedMsg is responsible for creating a Marshalled and Compressed object.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
// Package profiling exposes methods to manage profiling within gRPC.
|
// Package profiling exposes methods to manage profiling within gRPC.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
// queried by a client to remotely manage the gRPC profiling behaviour of an
|
// queried by a client to remotely manage the gRPC profiling behaviour of an
|
||||||
// application.
|
// application.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ type ServerReflectionRequest struct {
|
||||||
// defined field and then handles them using corresponding methods.
|
// defined field and then handles them using corresponding methods.
|
||||||
//
|
//
|
||||||
// Types that are assignable to MessageRequest:
|
// Types that are assignable to MessageRequest:
|
||||||
|
//
|
||||||
// *ServerReflectionRequest_FileByFilename
|
// *ServerReflectionRequest_FileByFilename
|
||||||
// *ServerReflectionRequest_FileContainingSymbol
|
// *ServerReflectionRequest_FileContainingSymbol
|
||||||
// *ServerReflectionRequest_FileContainingExtension
|
// *ServerReflectionRequest_FileContainingExtension
|
||||||
|
|
@ -263,6 +264,7 @@ type ServerReflectionResponse struct {
|
||||||
// message_request in the request.
|
// message_request in the request.
|
||||||
//
|
//
|
||||||
// Types that are assignable to MessageResponse:
|
// Types that are assignable to MessageResponse:
|
||||||
|
//
|
||||||
// *ServerReflectionResponse_FileDescriptorResponse
|
// *ServerReflectionResponse_FileDescriptorResponse
|
||||||
// *ServerReflectionResponse_AllExtensionNumbersResponse
|
// *ServerReflectionResponse_AllExtensionNumbersResponse
|
||||||
// *ServerReflectionResponse_ListServicesResponse
|
// *ServerReflectionResponse_ListServicesResponse
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,11 @@
|
||||||
Package grpc_testing_not_regenerate is a generated protocol buffer package.
|
Package grpc_testing_not_regenerate is a generated protocol buffer package.
|
||||||
|
|
||||||
It is generated from these files:
|
It is generated from these files:
|
||||||
|
|
||||||
testv3.proto
|
testv3.proto
|
||||||
|
|
||||||
It has these top-level messages:
|
It has these top-level messages:
|
||||||
|
|
||||||
SearchResponseV3
|
SearchResponseV3
|
||||||
SearchRequestV3
|
SearchRequestV3
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ The service implemented is defined in:
|
||||||
https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto.
|
https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto.
|
||||||
|
|
||||||
To register server reflection on a gRPC server:
|
To register server reflection on a gRPC server:
|
||||||
|
|
||||||
import "google.golang.org/grpc/reflection"
|
import "google.golang.org/grpc/reflection"
|
||||||
|
|
||||||
s := grpc.NewServer()
|
s := grpc.NewServer()
|
||||||
|
|
@ -32,7 +33,6 @@ To register server reflection on a gRPC server:
|
||||||
reflection.Register(s)
|
reflection.Register(s)
|
||||||
|
|
||||||
s.Serve(lis)
|
s.Serve(lis)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
package reflection // import "google.golang.org/grpc/reflection"
|
package reflection // import "google.golang.org/grpc/reflection"
|
||||||
|
|
||||||
|
|
@ -74,7 +74,7 @@ func Register(s GRPCServer) {
|
||||||
// for a custom implementation to return zero values for the
|
// for a custom implementation to return zero values for the
|
||||||
// grpc.ServiceInfo values in the map.
|
// grpc.ServiceInfo values in the map.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -85,7 +85,7 @@ type ServiceInfoProvider interface {
|
||||||
// ExtensionResolver is the interface used to query details about extensions.
|
// ExtensionResolver is the interface used to query details about extensions.
|
||||||
// This interface is satisfied by protoregistry.GlobalTypes.
|
// This interface is satisfied by protoregistry.GlobalTypes.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -96,7 +96,7 @@ type ExtensionResolver interface {
|
||||||
|
|
||||||
// ServerOptions represents the options used to construct a reflection server.
|
// ServerOptions represents the options used to construct a reflection server.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -120,7 +120,7 @@ type ServerOptions struct {
|
||||||
// This can be used to customize behavior of the reflection service. Most usages
|
// This can be used to customize behavior of the reflection service. Most usages
|
||||||
// should prefer to use Register instead.
|
// should prefer to use Register instead.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This function is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This function is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ const (
|
||||||
|
|
||||||
// Address represents a server the client connects to.
|
// Address represents a server the client connects to.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
39
rpc_util.go
39
rpc_util.go
|
|
@ -198,7 +198,7 @@ func Header(md *metadata.MD) CallOption {
|
||||||
// HeaderCallOption is a CallOption for collecting response header metadata.
|
// HeaderCallOption is a CallOption for collecting response header metadata.
|
||||||
// The metadata field will be populated *after* the RPC completes.
|
// The metadata field will be populated *after* the RPC completes.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -220,7 +220,7 @@ func Trailer(md *metadata.MD) CallOption {
|
||||||
// TrailerCallOption is a CallOption for collecting response trailer metadata.
|
// TrailerCallOption is a CallOption for collecting response trailer metadata.
|
||||||
// The metadata field will be populated *after* the RPC completes.
|
// The metadata field will be populated *after* the RPC completes.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -242,7 +242,7 @@ func Peer(p *peer.Peer) CallOption {
|
||||||
// PeerCallOption is a CallOption for collecting the identity of the remote
|
// PeerCallOption is a CallOption for collecting the identity of the remote
|
||||||
// peer. The peer field will be populated *after* the RPC completes.
|
// peer. The peer field will be populated *after* the RPC completes.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -282,7 +282,7 @@ func FailFast(failFast bool) CallOption {
|
||||||
// FailFastCallOption is a CallOption for indicating whether an RPC should fail
|
// FailFastCallOption is a CallOption for indicating whether an RPC should fail
|
||||||
// fast or not.
|
// fast or not.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -305,7 +305,7 @@ func MaxCallRecvMsgSize(bytes int) CallOption {
|
||||||
// MaxRecvMsgSizeCallOption is a CallOption that indicates the maximum message
|
// MaxRecvMsgSizeCallOption is a CallOption that indicates the maximum message
|
||||||
// size in bytes the client can receive.
|
// size in bytes the client can receive.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -328,7 +328,7 @@ func MaxCallSendMsgSize(bytes int) CallOption {
|
||||||
// MaxSendMsgSizeCallOption is a CallOption that indicates the maximum message
|
// MaxSendMsgSizeCallOption is a CallOption that indicates the maximum message
|
||||||
// size in bytes the client can send.
|
// size in bytes the client can send.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -351,7 +351,7 @@ func PerRPCCredentials(creds credentials.PerRPCCredentials) CallOption {
|
||||||
// PerRPCCredsCallOption is a CallOption that indicates the per-RPC
|
// PerRPCCredsCallOption is a CallOption that indicates the per-RPC
|
||||||
// credentials to use for the call.
|
// credentials to use for the call.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -369,7 +369,7 @@ func (o PerRPCCredsCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||||
// sending the request. If WithCompressor is also set, UseCompressor has
|
// sending the request. If WithCompressor is also set, UseCompressor has
|
||||||
// higher priority.
|
// higher priority.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -379,7 +379,7 @@ func UseCompressor(name string) CallOption {
|
||||||
|
|
||||||
// CompressorCallOption is a CallOption that indicates the compressor to use.
|
// CompressorCallOption is a CallOption that indicates the compressor to use.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -416,7 +416,7 @@ func CallContentSubtype(contentSubtype string) CallOption {
|
||||||
// ContentSubtypeCallOption is a CallOption that indicates the content-subtype
|
// ContentSubtypeCallOption is a CallOption that indicates the content-subtype
|
||||||
// used for marshaling messages.
|
// used for marshaling messages.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -444,7 +444,7 @@ func (o ContentSubtypeCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||||
// This function is provided for advanced users; prefer to use only
|
// This function is provided for advanced users; prefer to use only
|
||||||
// CallContentSubtype to select a registered codec instead.
|
// CallContentSubtype to select a registered codec instead.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -455,7 +455,7 @@ func ForceCodec(codec encoding.Codec) CallOption {
|
||||||
// ForceCodecCallOption is a CallOption that indicates the codec used for
|
// ForceCodecCallOption is a CallOption that indicates the codec used for
|
||||||
// marshaling messages.
|
// marshaling messages.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -480,7 +480,7 @@ func CallCustomCodec(codec Codec) CallOption {
|
||||||
// CustomCodecCallOption is a CallOption that indicates the codec used for
|
// CustomCodecCallOption is a CallOption that indicates the codec used for
|
||||||
// marshaling messages.
|
// marshaling messages.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -497,7 +497,7 @@ func (o CustomCodecCallOption) after(c *callInfo, attempt *csAttempt) {}
|
||||||
// MaxRetryRPCBufferSize returns a CallOption that limits the amount of memory
|
// MaxRetryRPCBufferSize returns a CallOption that limits the amount of memory
|
||||||
// used for buffering this RPC's requests for retry purposes.
|
// used for buffering this RPC's requests for retry purposes.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -508,7 +508,7 @@ func MaxRetryRPCBufferSize(bytes int) CallOption {
|
||||||
// MaxRetryRPCBufferSizeCallOption is a CallOption indicating the amount of
|
// MaxRetryRPCBufferSizeCallOption is a CallOption indicating the amount of
|
||||||
// memory to be used for caching this RPC for retry purposes.
|
// memory to be used for caching this RPC for retry purposes.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
@ -548,10 +548,11 @@ type parser struct {
|
||||||
// format. The caller owns the returned msg memory.
|
// format. The caller owns the returned msg memory.
|
||||||
//
|
//
|
||||||
// If there is an error, possible values are:
|
// If there is an error, possible values are:
|
||||||
// * io.EOF, when no messages remain
|
// - io.EOF, when no messages remain
|
||||||
// * io.ErrUnexpectedEOF
|
// - io.ErrUnexpectedEOF
|
||||||
// * of type transport.ConnectionError
|
// - of type transport.ConnectionError
|
||||||
// * an error from the status package
|
// - an error from the status package
|
||||||
|
//
|
||||||
// No other error values or types must be returned, which also means
|
// No other error values or types must be returned, which also means
|
||||||
// that the underlying io.Reader must not return an incompatible
|
// that the underlying io.Reader must not return an incompatible
|
||||||
// error.
|
// error.
|
||||||
|
|
|
||||||
|
|
@ -150,12 +150,12 @@ func x509NameHash(r pkix.RDNSequence) string {
|
||||||
|
|
||||||
// CheckRevocation checks the connection for revoked certificates based on RFC5280.
|
// CheckRevocation checks the connection for revoked certificates based on RFC5280.
|
||||||
// This implementation has the following major limitations:
|
// This implementation has the following major limitations:
|
||||||
// * Indirect CRL files are not supported.
|
// - Indirect CRL files are not supported.
|
||||||
// * CRL loading is only supported from directories in the X509_LOOKUP_hash_dir format.
|
// - CRL loading is only supported from directories in the X509_LOOKUP_hash_dir format.
|
||||||
// * OnlySomeReasons is not supported.
|
// - OnlySomeReasons is not supported.
|
||||||
// * Delta CRL files are not supported.
|
// - Delta CRL files are not supported.
|
||||||
// * Certificate CRLDistributionPoint must be URLs, but are then ignored and converted into a file path.
|
// - Certificate CRLDistributionPoint must be URLs, but are then ignored and converted into a file path.
|
||||||
// * CRL checks are done after path building, which goes against RFC4158.
|
// - CRL checks are done after path building, which goes against RFC4158.
|
||||||
func CheckRevocation(conn tls.ConnectionState, cfg RevocationConfig) error {
|
func CheckRevocation(conn tls.ConnectionState, cfg RevocationConfig) error {
|
||||||
return CheckChainRevocation(conn.VerifiedChains, cfg)
|
return CheckChainRevocation(conn.VerifiedChains, cfg)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -253,13 +253,16 @@ func getDecision(engine *policyEngine, match bool) Decision {
|
||||||
return DecisionDeny
|
return DecisionDeny
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the authorization decision of a single policy engine based on activation.
|
// Returns the authorization decision of a single policy engine based on
|
||||||
// If any policy matches, the decision matches the engine's action, and the first
|
// activation. If any policy matches, the decision matches the engine's
|
||||||
// matching policy name will be returned.
|
// action, and the first matching policy name will be returned.
|
||||||
// Else if any policy is missing attributes, the decision is unknown, and the list of
|
//
|
||||||
// policy names that can't be evaluated due to missing attributes will be returned.
|
// Else if any policy is missing attributes, the decision is unknown, and the
|
||||||
// Else, the decision is the opposite of the engine's action, i.e. an ALLOW engine
|
// list of policy names that can't be evaluated due to missing attributes will
|
||||||
// will return DecisionDeny, and vice versa.
|
// be returned.
|
||||||
|
//
|
||||||
|
// Else, the decision is the opposite of the engine's action, i.e. an ALLOW
|
||||||
|
// engine will return DecisionDeny, and vice versa.
|
||||||
func (engine *policyEngine) evaluate(activation interpreter.Activation) (Decision, []string) {
|
func (engine *policyEngine) evaluate(activation interpreter.Activation) (Decision, []string) {
|
||||||
unknownPolicyNames := []string{}
|
unknownPolicyNames := []string{}
|
||||||
for policyName, program := range engine.programs {
|
for policyName, program := range engine.programs {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package serviceconfig defines types and methods for operating on gRPC
|
// Package serviceconfig defines types and methods for operating on gRPC
|
||||||
// service configs.
|
// service configs.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This package is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ type GaugeResponse struct {
|
||||||
|
|
||||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
// Types that are assignable to Value:
|
// Types that are assignable to Value:
|
||||||
|
//
|
||||||
// *GaugeResponse_LongValue
|
// *GaugeResponse_LongValue
|
||||||
// *GaugeResponse_DoubleValue
|
// *GaugeResponse_DoubleValue
|
||||||
// *GaugeResponse_StringValue
|
// *GaugeResponse_StringValue
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package tap defines the function handles which are executed on the transport
|
// Package tap defines the function handles which are executed on the transport
|
||||||
// layer of gRPC-Go and related information.
|
// layer of gRPC-Go and related information.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// Package bootstrap provides the functionality to register possible options
|
// Package bootstrap provides the functionality to register possible options
|
||||||
// for aspects of the xDS client through the bootstrap file.
|
// for aspects of the xDS client through the bootstrap file.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This package is EXPERIMENTAL and may be changed or removed
|
// Notice: This package is EXPERIMENTAL and may be changed or removed
|
||||||
// in a later release.
|
// in a later release.
|
||||||
|
|
|
||||||
|
|
@ -41,30 +41,44 @@ var (
|
||||||
// from a priority to another).
|
// from a priority to another).
|
||||||
//
|
//
|
||||||
// It's guaranteed that after this function returns:
|
// It's guaranteed that after this function returns:
|
||||||
// - If some child is READY, it is childInUse, and all lower priorities are
|
//
|
||||||
|
// If some child is READY, it is childInUse, and all lower priorities are
|
||||||
// closed.
|
// closed.
|
||||||
// - If some child is newly started(in Connecting for the first time), it is
|
//
|
||||||
|
// If some child is newly started(in Connecting for the first time), it is
|
||||||
// childInUse, and all lower priorities are closed.
|
// childInUse, and all lower priorities are closed.
|
||||||
// - Otherwise, the lowest priority is childInUse (none of the children is
|
//
|
||||||
|
// Otherwise, the lowest priority is childInUse (none of the children is
|
||||||
// ready, and the overall state is not ready).
|
// ready, and the overall state is not ready).
|
||||||
//
|
//
|
||||||
// Steps:
|
// Steps:
|
||||||
// - If all priorities were deleted, unset childInUse (to an empty string), and
|
//
|
||||||
|
// If all priorities were deleted, unset childInUse (to an empty string), and
|
||||||
// set parent ClientConn to TransientFailure
|
// set parent ClientConn to TransientFailure
|
||||||
// - Otherwise, Scan all children from p0, and check balancer stats:
|
//
|
||||||
// - For any of the following cases:
|
// Otherwise, Scan all children from p0, and check balancer stats:
|
||||||
// - If balancer is not started (not built), this is either a new child with
|
//
|
||||||
|
// For any of the following cases:
|
||||||
|
//
|
||||||
|
// If balancer is not started (not built), this is either a new child with
|
||||||
// high priority, or a new builder for an existing child.
|
// high priority, or a new builder for an existing child.
|
||||||
// - If balancer is Connecting and has non-nil initTimer (meaning it
|
//
|
||||||
|
// If balancer is Connecting and has non-nil initTimer (meaning it
|
||||||
// transitioned from Ready or Idle to connecting, not from TF, so we
|
// transitioned from Ready or Idle to connecting, not from TF, so we
|
||||||
// should give it init-time to connect).
|
// should give it init-time to connect).
|
||||||
// - If balancer is READY or IDLE
|
//
|
||||||
// - If this is the lowest priority
|
// If balancer is READY or IDLE
|
||||||
// - do the following:
|
//
|
||||||
// - if this is not the old childInUse, override picker so old picker is no
|
// If this is the lowest priority
|
||||||
|
//
|
||||||
|
// do the following:
|
||||||
|
//
|
||||||
|
// if this is not the old childInUse, override picker so old picker is no
|
||||||
// longer used.
|
// longer used.
|
||||||
// - switch to it (because all higher priorities are neither new or Ready)
|
//
|
||||||
// - forward the new addresses and config
|
// switch to it (because all higher priorities are neither new or Ready)
|
||||||
|
//
|
||||||
|
// forward the new addresses and config
|
||||||
//
|
//
|
||||||
// Caller must hold b.mu.
|
// Caller must hold b.mu.
|
||||||
func (b *priorityBalancer) syncPriority(childUpdating string) {
|
func (b *priorityBalancer) syncPriority(childUpdating string) {
|
||||||
|
|
|
||||||
|
|
@ -328,6 +328,7 @@ func (b *ringhashBalancer) ResolverError(err error) {
|
||||||
// - the new state is TransientFailure, to update the error message
|
// - the new state is TransientFailure, to update the error message
|
||||||
// - it's possible that this is a noop, but sending an extra update is easier
|
// - it's possible that this is a noop, but sending an extra update is easier
|
||||||
// than comparing errors
|
// than comparing errors
|
||||||
|
//
|
||||||
// - the aggregated state is changed
|
// - the aggregated state is changed
|
||||||
// - the same picker will be sent again, but this update may trigger a re-pick
|
// - the same picker will be sent again, but this update may trigger a re-pick
|
||||||
// for some RPCs.
|
// for some RPCs.
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ func TestPingPong(t *testing.T) {
|
||||||
// - verify that
|
// - verify that
|
||||||
// - all RPCs with the same metadata value are sent to the same backend
|
// - all RPCs with the same metadata value are sent to the same backend
|
||||||
// - only one backend is Ready
|
// - only one backend is Ready
|
||||||
|
//
|
||||||
// - send more RPCs with different metadata values until a new backend is picked, and verify that
|
// - send more RPCs with different metadata values until a new backend is picked, and verify that
|
||||||
// - only two backends are in Ready
|
// - only two backends are in Ready
|
||||||
func TestAffinity(t *testing.T) {
|
func TestAffinity(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ func newWithConfig(config *bootstrap.Config, watchExpiryTimeout time.Duration, i
|
||||||
// NewWithConfigForTesting returns an xDS client for the specified bootstrap
|
// NewWithConfigForTesting returns an xDS client for the specified bootstrap
|
||||||
// config, separate from the global singleton.
|
// config, separate from the global singleton.
|
||||||
//
|
//
|
||||||
// Testing Only
|
// # Testing Only
|
||||||
//
|
//
|
||||||
// This function should ONLY be used for testing purposes.
|
// This function should ONLY be used for testing purposes.
|
||||||
func NewWithConfigForTesting(config *bootstrap.Config, watchExpiryTimeout, authorityIdleTimeout time.Duration) (XDSClient, error) {
|
func NewWithConfigForTesting(config *bootstrap.Config, watchExpiryTimeout, authorityIdleTimeout time.Duration) (XDSClient, error) {
|
||||||
|
|
@ -86,8 +86,7 @@ func NewWithConfigForTesting(config *bootstrap.Config, watchExpiryTimeout, autho
|
||||||
// NewWithBootstrapContentsForTesting returns an xDS client for this config,
|
// NewWithBootstrapContentsForTesting returns an xDS client for this config,
|
||||||
// separate from the global singleton.
|
// separate from the global singleton.
|
||||||
//
|
//
|
||||||
//
|
// # Testing Only
|
||||||
// Testing Only
|
|
||||||
//
|
//
|
||||||
// This function should ONLY be used for testing purposes.
|
// This function should ONLY be used for testing purposes.
|
||||||
func NewWithBootstrapContentsForTesting(contents []byte) (XDSClient, error) {
|
func NewWithBootstrapContentsForTesting(contents []byte) (XDSClient, error) {
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ func (s) TestClusterWatchExpiryTimerStop(t *testing.T) {
|
||||||
// - an update is received after a watch()
|
// - an update is received after a watch()
|
||||||
// - another update is received, with one resource removed
|
// - another update is received, with one resource removed
|
||||||
// - this should trigger callback with resource removed error
|
// - this should trigger callback with resource removed error
|
||||||
|
//
|
||||||
// - one more update without the removed resource
|
// - one more update without the removed resource
|
||||||
// - the callback (above) shouldn't receive any update
|
// - the callback (above) shouldn't receive any update
|
||||||
func (s) TestClusterResourceRemoved(t *testing.T) {
|
func (s) TestClusterResourceRemoved(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -428,6 +428,7 @@ func testWatchAfterCache(t *testing.T, typ xdsresource.ResourceType, update inte
|
||||||
// - an update is received after a watch()
|
// - an update is received after a watch()
|
||||||
// - another update is received, with one resource removed
|
// - another update is received, with one resource removed
|
||||||
// - this should trigger callback with resource removed error
|
// - this should trigger callback with resource removed error
|
||||||
|
//
|
||||||
// - one more update without the removed resource
|
// - one more update without the removed resource
|
||||||
// - the callback (above) shouldn't receive any update
|
// - the callback (above) shouldn't receive any update
|
||||||
func testResourceRemoved(t *testing.T, typ xdsresource.ResourceType, update1 interface{}, resourceName1 string, update2 interface{}, resourceName2 string) {
|
func testResourceRemoved(t *testing.T, typ xdsresource.ResourceType, update1 interface{}, resourceName1 string, update2 interface{}, resourceName2 string) {
|
||||||
|
|
|
||||||
|
|
@ -209,16 +209,19 @@ func match(domain, host string) (domainMatchType, bool) {
|
||||||
// matches host
|
// matches host
|
||||||
//
|
//
|
||||||
// The domains field support 4 different matching pattern types:
|
// The domains field support 4 different matching pattern types:
|
||||||
|
//
|
||||||
// - Exact match
|
// - Exact match
|
||||||
// - Suffix match (e.g. “*ABC”)
|
// - Suffix match (e.g. “*ABC”)
|
||||||
// - Prefix match (e.g. “ABC*)
|
// - Prefix match (e.g. “ABC*)
|
||||||
// - Universal match (e.g. “*”)
|
// - Universal match (e.g. “*”)
|
||||||
//
|
//
|
||||||
// The best match is defined as:
|
// The best match is defined as:
|
||||||
// - A match is better if it’s matching pattern type is better
|
// - A match is better if it’s matching pattern type is better.
|
||||||
// - Exact match > suffix match > prefix match > universal match
|
// * Exact match > suffix match > prefix match > universal match.
|
||||||
// - If two matches are of the same pattern type, the longer match is better
|
//
|
||||||
// - This is to compare the length of the matching pattern, e.g. “*ABCDE” >
|
// - If two matches are of the same pattern type, the longer match is
|
||||||
|
// better.
|
||||||
|
// * This is to compare the length of the matching pattern, e.g. “*ABCDE” >
|
||||||
// “*ABC”
|
// “*ABC”
|
||||||
func FindBestMatchingVirtualHost(host string, vHosts []*VirtualHost) *VirtualHost { // Maybe move this crap to client
|
func FindBestMatchingVirtualHost(host string, vHosts []*VirtualHost) *VirtualHost { // Maybe move this crap to client
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -62,12 +62,12 @@ type ServingModeChangeArgs struct {
|
||||||
// to inject a bootstrap configuration used by only this server, instead of the
|
// to inject a bootstrap configuration used by only this server, instead of the
|
||||||
// global configuration from the environment variables.
|
// global configuration from the environment variables.
|
||||||
//
|
//
|
||||||
// Testing Only
|
// # Testing Only
|
||||||
//
|
//
|
||||||
// This function should ONLY be used for testing and may not work with some
|
// This function should ONLY be used for testing and may not work with some
|
||||||
// other features, including the CSDS service.
|
// other features, including the CSDS service.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,12 @@ func init() {
|
||||||
// the supported environment variables. The resolver.Builder is meant to be
|
// the supported environment variables. The resolver.Builder is meant to be
|
||||||
// used in conjunction with the grpc.WithResolvers DialOption.
|
// used in conjunction with the grpc.WithResolvers DialOption.
|
||||||
//
|
//
|
||||||
// Testing Only
|
// # Testing Only
|
||||||
//
|
//
|
||||||
// This function should ONLY be used for testing and may not work with some
|
// This function should ONLY be used for testing and may not work with some
|
||||||
// other features, including the CSDS service.
|
// other features, including the CSDS service.
|
||||||
//
|
//
|
||||||
// Experimental
|
// # Experimental
|
||||||
//
|
//
|
||||||
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
|
||||||
// later release.
|
// later release.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue