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

Function NewOutgoingContext

metadata/metadata.go:172–174  ·  view source on GitHub ↗

NewOutgoingContext creates a new context with outgoing md attached. If used in conjunction with AppendToOutgoingContext, NewOutgoingContext will overwrite any previously-appended metadata. md must not be modified after calling this function.

(ctx context.Context, md MD)

Source from the content-addressed store, hash-verified

170// overwrite any previously-appended metadata. md must not be modified after
171// calling this function.
172func NewOutgoingContext(ctx context.Context, md MD) context.Context {
173 return context.WithValue(ctx, mdOutgoingKey{}, rawMD{md: md})
174}
175
176// AppendToOutgoingContext returns a new context with the provided kv merged
177// with any existing metadata in the context. Please refer to the documentation

Callers 15

newStreamMethod · 0.92
doUnaryCallMethod · 0.92
doClientStreamCallMethod · 0.92
doServerStreamCallMethod · 0.92
setupStreamFunction · 0.92
DoPerRPCCredsFunction · 0.92
DoCancelAfterBeginFunction · 0.92
DoCustomMetadataFunction · 0.92
makeOneRPCFunction · 0.92

Calls 1

WithValueMethod · 0.80