MCPcopy
hub / github.com/gofiber/fiber / Context

Method Context

ctx.go:134–144  ·  view source on GitHub ↗

Context returns a context implementation that was set by user earlier or returns a non-nil, empty context, if it was not set earlier.

()

Source from the content-addressed store, hash-verified

132// Context returns a context implementation that was set by
133// user earlier or returns a non-nil, empty context, if it was not set earlier.
134func (c *DefaultCtx) Context() context.Context {
135 if c.fasthttp == nil {
136 return context.Background()
137 }
138 if ctx, ok := c.fasthttp.UserValue(userContextKey).(context.Context); ok && ctx != nil {
139 return ctx
140 }
141 ctx := context.Background()
142 c.SetContext(ctx)
143 return ctx
144}
145
146// SetContext sets a context implementation by user.
147func (c *DefaultCtx) SetContext(ctx context.Context) {

Callers 1

SaveFileToStorageMethod · 0.95

Calls 2

SetContextMethod · 0.95
UserValueMethod · 0.65

Tested by

no test coverage detected