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

Function NewContextWithServerTransportStream

server.go:1903–1905  ·  view source on GitHub ↗

NewContextWithServerTransportStream creates a new context from ctx and attaches stream to it. # Experimental Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

(ctx context.Context, stream ServerTransportStream)

Source from the content-addressed store, hash-verified

1901// Notice: This API is EXPERIMENTAL and may be changed or removed in a
1902// later release.
1903func NewContextWithServerTransportStream(ctx context.Context, stream ServerTransportStream) context.Context {
1904 return context.WithValue(ctx, streamKey{}, stream)
1905}
1906
1907// ServerTransportStream is a minimal interface that a transport stream must
1908// implement. This can be used to mock an actual transport stream for tests of

Callers 5

TestChainEngineMethod · 0.92
unaryInterceptorMethod · 0.92
processUnaryRPCMethod · 0.85
processStreamingRPCMethod · 0.85
TestStreamContextMethod · 0.85

Calls 1

WithValueMethod · 0.80

Tested by 2

TestChainEngineMethod · 0.74
TestStreamContextMethod · 0.68