MCPcopy Create free account
hub / github.com/devfeel/dotweb / SetTimeoutContext

Method SetTimeoutContext

context.go:201–205  ·  view source on GitHub ↗

SetTimeoutContext set new Timeout Context set Context & cancle withvalue RequestID

(timeout time.Duration)

Source from the content-addressed store, hash-verified

199// set Context & cancle
200// withvalue RequestID
201func (ctx *HttpContext) SetTimeoutContext(timeout time.Duration) context.Context {
202 ctx.context, ctx.cancel = context.WithTimeout(context.Background(), timeout)
203 ctx.context = context.WithValue(ctx.context, "RequestID", ctx.Request().RequestID())
204 return ctx.context
205}
206
207// WithContext set Context with RequestID
208func (ctx *HttpContext) WithContext(runCtx context.Context) {

Callers

nothing calls this directly

Calls 2

RequestMethod · 0.95
RequestIDMethod · 0.80

Tested by

no test coverage detected