Keys returns the keys stored in the carrier's context metadata. It returns keys from outgoing context metadata.
()
| 113 | // Keys returns the keys stored in the carrier's context metadata. It returns |
| 114 | // keys from outgoing context metadata. |
| 115 | func (c *OutgoingCarrier) Keys() []string { |
| 116 | md, ok := metadata.FromOutgoingContext(c.ctx) |
| 117 | if !ok { |
| 118 | return nil |
| 119 | } |
| 120 | keys := make([]string, 0, len(md)) |
| 121 | for key := range md { |
| 122 | keys = append(keys, key) |
| 123 | } |
| 124 | return keys |
| 125 | } |
| 126 | |
| 127 | // Context returns the underlying context associated with the |
| 128 | // `OutgoingCarrier“. |