SetMetadata sets a metadata key-value pair in the request context.
(req *http.Request, key string, value any)
| 72 | |
| 73 | // SetMetadata sets a metadata key-value pair in the request context. |
| 74 | func SetMetadata(req *http.Request, key string, value any) { |
| 75 | meta, ok := req.Context().Value(metaCtxKey{}).(map[string]any) |
| 76 | if !ok || meta == nil { |
| 77 | return |
| 78 | } |
| 79 | |
| 80 | meta[key] = value |
| 81 | } |
| 82 | |
| 83 | // Report reports an error to all configured reporters with the request and its metadata. |
| 84 | func (r *Reporter) Report(err errctx.Error, req *http.Request) { |
no outgoing calls
no test coverage detected