MCPcopy
hub / github.com/grpc/grpc-go / NewContextWithRequestInfo

Function NewContextWithRequestInfo

credentials/credentials.go:260–262  ·  view source on GitHub ↗

NewContextWithRequestInfo creates a new context from ctx and attaches ri to it. This RequestInfo will be accessible via RequestInfoFromContext. Intended to be used from tests for PerRPCCredentials implementations (that often need to check connection's SecurityLevel). Should not be used from non-te

(ctx context.Context, ri RequestInfo)

Source from the content-addressed store, hash-verified

258//
259// This API is experimental.
260func NewContextWithRequestInfo(ctx context.Context, ri RequestInfo) context.Context {
261 return context.WithValue(ctx, requestInfoKey{}, ri)
262}
263
264// ClientHandshakeInfo holds data to be passed to ClientHandshake. This makes
265// it possible to pass arbitrary data to the handshaker from gRPC, resolver,

Calls 1

WithValueMethod · 0.80