SetTimeoutContext set new Timeout Context set Context & cancle withvalue RequestID
(timeout time.Duration)
| 199 | // set Context & cancle |
| 200 | // withvalue RequestID |
| 201 | func (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 |
| 208 | func (ctx *HttpContext) WithContext(runCtx context.Context) { |