package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
ClearIncomingContext "removes" the gRPC incoming metadata if there's any already.
ClearIncomingContextExcept removes the gRPC incoming metadata if there is any, except for metadata items identified by the given keys.
FastFirstValueFromIncomingContext is a specialization of metadata.ValueFromIncomingContext() which extracts the first string from the given metadata key, if it exists.
FastFromIncomingContext is a specialization of metadata.FromIncomingContext() which extracts the metadata.MD from the context, if any, by reference.
IsAuthError returns true if err's Cause is an authentication or authorization error for the operation.
IsClosedConnection returns true if err's Cause is an error produced by gRPC on closed connections.
IsConnectionRejected returns true if err's cause is an error produced by gRPC due to remote node being unavailable and retrying immediately would not fix the problem.
IsConnectionUnavailable checks if grpc code is either codes.Unavailable which is set when we are not able to establish connection to remote node or codes.FailedPrecondition when node itself blocked access to remote node because it is marked as decommissioned in the local tombstone storage.
IsContextCanceled returns true if err's Cause is an error produced by gRPC on context cancellation.
IsLocalRequestContext returns true if this context is marked for local (in-process) use.
IsTimeout returns true if err's Cause is a gRPC timeout, or the request was canceled by a context timeout.
IsWaitingForInit checks whether the provided error is because the node is still waiting for initialization.
LowerSeverity ensures that the severity level below which GRPC log messages are suppressed is at most the specified severity.
NewLocalRequestContext returns a Context that can be used for local (in-process) RPC requests performed by the InternalClientAdapter.
RequestDidNotStart returns true if the given RPC error means that the request definitely could not have started on the remote server.
# Variables
ErrConnectionInterrupted is returned when a failed connection is being reused.