MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / RequestIDFromContext

Function RequestIDFromContext

internal/httpapi/middleware.go:37–45  ·  view source on GitHub ↗

RequestIDFromContext returns the request id stamped by the requestID middleware, or "" if none is present.

(ctx context.Context)

Source from the content-addressed store, hash-verified

35// RequestIDFromContext returns the request id stamped by the requestID
36// middleware, or "" if none is present.
37func RequestIDFromContext(ctx context.Context) string {
38 if ctx == nil {
39 return ""
40 }
41 if id, ok := ctx.Value(requestIDKey).(string); ok {
42 return id
43 }
44 return ""
45}
46
47// requestID middleware honors a caller-supplied X-Request-Id (so a trace id
48// can flow across services) and otherwise mints one, then stashes it in the

Callers 3

writeEnvelopeFunction · 0.85
writeRawErrorFunction · 0.85
stampRequestIDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected