package internal
Import Path
google.golang.org/grpc/internal (on go.dev)
Dependency Relation
imports 7 packages, and imported by 10 packages
Involved Source Files
experimental.go
Package internal contains gRPC-internal code, to avoid polluting
the godoc of the top-level grpc package. It must not import any grpc
symbols to avoid circular dependencies.
tcp_keepalive_unix.go
Package-Level Type Names (total 4, all are exported)
EnforceClientConnEmbedding is used to enforce proper ClientConn implementation
embedding.
( EnforceClientConnEmbedding) enforceClientConnEmbedding()
google.golang.org/grpc/balancer.ClientConn (interface)
google.golang.org/grpc/internal/balancer/gracefulswitch.balancerWrapper
google.golang.org/grpc.ccBalancerWrapper
google.golang.org/grpc/balancer/endpointsharding.balancerWrapper
EnforceSubConnEmbedding is used to enforce proper SubConn implementation
embedding.
( EnforceSubConnEmbedding) enforceSubConnEmbedding()
google.golang.org/grpc/balancer.SubConn (interface)
google.golang.org/grpc.acBalancerWrapper
HealthChecker defines the signature of the client-side LB channel health
checking function.
The implementation is expected to create a health checking RPC stream by
calling newStream(), watch for the health status of serviceName, and report
its health back by calling setConnectivityState().
The health checking protocol is defined at:
https://github.com/grpc/grpc/blob/master/doc/health-checking.md
var HealthCheckFunc
Timer is an interface to allow injecting different time.Timer implementations
during tests.
( Timer) Stop() bool
go.pact.im/x/clock.Event (interface)
go.pact.im/x/clock.Timer (interface)
*go.pact.im/x/clock/mockclock.MockTimer
*time.Timer
*go.pact.im/x/clock.eventTimer
go.pact.im/x/clock.runtimeTimer
*go.pact.im/x/clock/fakeclock.event
*go.pact.im/x/clock/fakeclock.timer
golang.org/x/net/http2.timeTimer
net/http.http2timeTimer
Package-Level Functions (only one, which is exported)
NetDialerWithTCPKeepalive returns a net.Dialer that enables TCP keepalives on
the underlying connection with OS default values for keepalive parameters.
TODO: Once https://github.com/golang/go/issues/62254 lands, and the
appropriate Go version becomes less than our least supported Go version, we
should look into using the new API to make things more straightforward.
Package-Level Variables (total 46, all are exported)
AddGlobalDialOptions adds an array of DialOption that will be effective
globally for newly created client channels. The priority will be: 1.
user-provided; 2. this method; 3. default values.
This is used in the 1.0 release of gcp/observability, and thus must not be
deleted or changed.
AddGlobalPerTargetDialOptions adds a PerTargetDialOption that will be
configured for newly created ClientConns.
AddGlobalServerOptions adds an array of ServerOption that will be
effective globally for newly created servers. The priority will be: 1.
user-provided; 2. this method; 3. default values.
This is used in the 1.0 release of gcp/observability, and thus must not be
deleted or changed.
BalancerUnregister is exported by package balancer to unregister a balancer.
BinaryLogger returns a ServerOption that can set the binary logger for a
server.
This is used in the 1.0 release of gcp/observability, and thus must not be
deleted or changed.
BufferPool is implemented by the grpc package and returns a server
option to configure a shared buffer pool for a grpc.Server.
CanonicalString returns the canonical string of the code defined here:
https://github.com/grpc/grpc/blob/master/doc/statuscodes.md.
This is used in the 1.0 release of gcp/observability, and thus must not be
deleted or changed.
ChannelzTurnOffForTesting disables the Channelz service for testing
purposes.
ClearGlobalDialOptions clears the array of extra DialOption. This
method is useful in testing and benchmarking.
This is used in the 1.0 release of gcp/observability, and thus must not be
deleted or changed.
ClearGlobalPerTargetDialOptions clears the slice of global late apply
dial options.
ClearGlobalServerOptions clears the array of extra ServerOption. This
method is useful in testing and benchmarking.
This is used in the 1.0 release of gcp/observability, and thus must not be
deleted or changed.
ConnectedAddress returns the connected address for a SubConnState. The
address is only valid if the state is READY.
DisableGlobalDialOptions returns a DialOption that prevents the
ClientConn from applying the global DialOptions (set via
AddGlobalDialOptions).
This is used in the 1.0 release of gcp/observability, and thus must not be
deleted or changed.
EnterIdleModeForTesting gets the ClientConn to enter IDLE mode.
EqualServiceConfigForTesting is for testing service config generation and
parsing. Both a and b should be returned by ParseServiceConfig.
This function compares the config without rawJSON stripped, in case the
there's difference in white space.
ExitIdleModeForTesting gets the ClientConn to exit IDLE mode.
FromOutgoingContextRaw returns the un-merged, intermediary contents of
metadata.rawMD.
GetCertificateProviderBuilder returns the registered builder for the
given name. This is set by package certprovider for use from xDS
bootstrap code while parsing certificate provider configs in the
bootstrap file.
GetServerCredentials returns the transport credentials configured on a
gRPC server. An xDS-enabled server needs to know what type of credentials
is configured on the underlying gRPC server. This is set by server.go.
GetXDSHandshakeInfoForTesting returns a pointer to the xds.HandshakeInfo
stored in the passed in attributes. This is set by
credentials/xds/xds.go.
GRPCResolverSchemeExtraMetadata determines when gRPC will add extra
metadata to RPCs.
HealthCheckFunc is used to provide client-side LB channel health checking
IsRegisteredMethod returns whether the passed in method is registered as
a method on the server.
JoinDialOptions combines the dial options passed as arguments into a
single dial option.
JoinServerOptions combines the server options passed as arguments into a
single server option.
KeepaliveMinPingTime is the minimum ping interval. This must be 10s by
default, but tests may wish to set it lower for convenience.
KeepaliveMinServerPingTime is the minimum ping interval for servers.
This must be 1s by default, but tests may wish to set it lower for
convenience.
MetricsRecorderForServer returns the MetricsRecorderList derived from a
server's stats handlers.
NewStreamWaitingForResolver is a test hook that is triggered when a
new stream blocks while waiting for name resolution. This can be
used in tests to synchronize resolver updates and avoid race conditions.
When set, the function will be called before the stream enters
the blocking state.
NewXDSResolverWithClientForTesting creates a new xDS resolver builder
using the provided xDS client instead of creating a new one using the
bootstrap configuration specified by the supported environment variables.
The resolver.Builder is meant to be used in conjunction with the
grpc.WithResolvers DialOption. The resolver.Builder does not take
ownership of the provided xDS client and it is the responsibility of the
caller to close the client when no longer required.
Testing Only
This function should ONLY be used for testing and may not work with some
other features, including the CSDS service.
NewXDSResolverWithConfigForTesting creates a new xds resolver builder using
the provided xds bootstrap config instead of the global configuration from
the supported environment variables. The resolver.Builder is meant to be
used in conjunction with the grpc.WithResolvers DialOption.
Testing Only
This function should ONLY be used for testing and may not work with some
other features, including the CSDS service.
NewXDSResolverWithPoolForTesting creates a new xDS resolver builder
using the provided xDS pool instead of creating a new one using the
bootstrap configuration specified by the supported environment variables.
The resolver.Builder is meant to be used in conjunction with the
grpc.WithResolvers DialOption. The resolver.Builder does not take
ownership of the provided xDS client and it is the responsibility of the
caller to close the client when no longer required.
Testing Only
This function should ONLY be used for testing and may not work with some
other features, including the CSDS service.
ORCAAllowAnyMinReportingInterval is for examples/orca use ONLY.
ParseServiceConfig parses a JSON representation of the service config.
RegisterClientHealthCheckListener is used to provide a listener for
updates from the client-side health checking service. It returns a
function that can be called to stop the health producer.
ServerFromContext returns the server from the context.
SetBufferPoolingThresholdForTesting updates the buffer pooling threshold, for
testing purposes.
SetConnectedAddress sets the connected address for a SubConnState.
SetDefaultBufferPoolForTesting updates the default buffer pool, for
testing purposes.
SnapshotMetricRegistryForTesting snapshots the global data of the metric
registry. Returns a cleanup function that sets the metric registry to its
original state. Only called in testing functions.
SubscribeToConnectivityStateChanges adds a grpcsync.Subscriber to a
provided grpc.ClientConn.
TimeAfterFunc is used to create timers. During tests the function is
replaced to track allocated timers and fail the test if a timer isn't
cancelled.
TriggerXDSResourceNotFoundForTesting causes the provided xDS Client to
invoke resource-not-found error for the given resource type and name.
UserSetDefaultScheme is set to true if the user has overridden the
default resolver scheme.
WithBinaryLogger returns a DialOption that specifies the binary logger
for a ClientConn.
This is used in the 1.0 release of gcp/observability, and thus must not be
deleted or changed.
WithBufferPool is implemented by the grpc package and returns a dial
option to configure a shared buffer pool for a grpc.ClientConn.
Package-Level Constants (total 4, all are exported)
CredsBundleModeBackendFromBalancer switches GoogleDefaultCreds to mode
that supports backend returned by grpclb balancer.
CredsBundleModeBalancer switches GoogleDefaultCreds to grpclb balancer
mode.
CredsBundleModeFallback switches GoogleDefaultCreds to fallback mode.
RLSLoadBalancingPolicyName is the name of the RLS LB policy.
It currently has an experimental suffix which would be removed once
end-to-end testing of the policy is completed.
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)