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

Method WithValue

attributes/attributes.go:65–71  ·  view source on GitHub ↗

WithValue returns a new Attributes containing the previous keys and values and the new key/value pair. If the same key appears multiple times, the last value overwrites all previous values for that key. value should not be modified later. Note that Attributes do not support deletion. Avoid using

(key, value any)

Source from the content-addressed store, hash-verified

63// storing a specific sentinel type or a wrapper struct with a boolean field
64// indicating presence.
65func (a *Attributes) WithValue(key, value any) *Attributes {
66 return &Attributes{
67 parent: a,
68 key: key,
69 value: value,
70 }
71}
72
73// Value returns the value associated with these attributes for key, or nil if
74// no value is associated with key. The returned value should not be modified.

Callers 15

contextWithServerFunction · 0.80
newContextWithRPCInfoFunction · 0.80
securityLevelLockedMethod · 0.80
setListenerInfoFunction · 0.80
NewContextFunction · 0.80
newContextWithLocalKeyFunction · 0.80
newContextWithGlobalKeyFunction · 0.80
contextWithORCAResultFunction · 0.80
setConfigKeyFunction · 0.80

Calls

no outgoing calls