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

Function Set

internal/metadata/metadata.go:74–77  ·  view source on GitHub ↗

Set sets (overrides) the metadata in addr. When a SubConn is created with this address, the RPCs sent on it will all have this metadata.

(addr resolver.Address, md metadata.MD)

Source from the content-addressed store, hash-verified

72// When a SubConn is created with this address, the RPCs sent on it will all
73// have this metadata.
74func Set(addr resolver.Address, md metadata.MD) resolver.Address {
75 addr.Attributes = addr.Attributes.WithValue(mdKey, mdValue(md))
76 return addr
77}
78
79// Validate validates every pair in md with ValidatePair.
80func Validate(md metadata.MD) error {

Callers 1

TestSetFunction · 0.70

Calls 2

mdValueTypeAlias · 0.85
WithValueMethod · 0.80

Tested by 1

TestSetFunction · 0.56