MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / BuildContext

Function BuildContext

pkg/httptrigger/context.go:26–36  ·  view source on GitHub ↗
(c *routing.Context)

Source from the content-addressed store, hash-verified

24)
25
26func BuildContext(c *routing.Context) *Context {
27 requestID := string(c.Request.Header.Peek(api.HeaderXRequestID))
28 if len(requestID) == 0 {
29 requestID = id.GetRequestID()
30 }
31 return &Context{
32 RequestID: requestID,
33 Logger: logs.NewLogger().WithField("request_id", requestID),
34 Context: c,
35 }
36}
37
38func (c *Context) WriteWithErrorLog(msg string) {
39 c.Logger.Error(msg)

Callers 1

ProxyHandlerFunction · 0.70

Calls 3

GetRequestIDFunction · 0.92
NewLoggerFunction · 0.92
WithFieldMethod · 0.80

Tested by

no test coverage detected