MCPcopy Create free account
hub / github.com/Azure/peerd / FillCorrelationId

Function FillCorrelationId

pkg/context/context.go:78–84  ·  view source on GitHub ↗

FillCorrelationId fills the correlation ID in the context.

(c Context)

Source from the content-addressed store, hash-verified

76
77// FillCorrelationId fills the correlation ID in the context.
78func FillCorrelationId(c Context) {
79 correlationId := c.Request.Header.Get(CorrelationHeaderKey)
80 if correlationId == "" {
81 correlationId = uuid.New().String()
82 }
83 c.Set(CorrelationIdCtxKey, correlationId)
84}
85
86// SetOutboundHeaders sets the mandatory headers for all outbound requests.
87func SetOutboundHeaders(r *http.Request, c Context) {

Callers 2

TestSetOutboundHeadersFunction · 0.85
TestFillCorrelationIdFunction · 0.85

Calls 2

SetMethod · 0.80
GetMethod · 0.45

Tested by 2

TestSetOutboundHeadersFunction · 0.68
TestFillCorrelationIdFunction · 0.68