Get returns the metadata of addr.
(addr resolver.Address)
| 59 | |
| 60 | // Get returns the metadata of addr. |
| 61 | func Get(addr resolver.Address) metadata.MD { |
| 62 | attrs := addr.Attributes |
| 63 | if attrs == nil { |
| 64 | return nil |
| 65 | } |
| 66 | md, _ := attrs.Value(mdKey).(mdValue) |
| 67 | return metadata.MD(md) |
| 68 | } |
| 69 | |
| 70 | // Set sets (overrides) the metadata in addr. |
| 71 | // |