MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / SetMetadata

Function SetMetadata

errorreport/errorreport.go:74–81  ·  view source on GitHub ↗

SetMetadata sets a metadata key-value pair in the request context.

(req *http.Request, key string, value any)

Source from the content-addressed store, hash-verified

72
73// SetMetadata sets a metadata key-value pair in the request context.
74func 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.
84func (r *Reporter) Report(err errctx.Error, req *http.Request) {

Callers 2

newRequestMethod · 0.92
WithReportErrorMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected