(ctx context.Context)
| 22 | } |
| 23 | |
| 24 | func MapFromContext(ctx context.Context) map[string]string { |
| 25 | requestContextMap, ok := ctx.Value(requestMetadataContextKey).(map[string]string) |
| 26 | if !ok { |
| 27 | return nil |
| 28 | } |
| 29 | return requestContextMap |
| 30 | } |
| 31 | |
| 32 | // ContextWithRequestMetadataMapFromHeaders adds MetadataContext headers to context and Removes non-existent headers. |
| 33 | // targetHeaders is passed for backwards compatibility, otherwise header keys should be in header itself. |