WithContext is a HandlerOption that sets the base context for all invocations of the handler.
(ctx context.Context)
| 39 | |
| 40 | // WithContext is a HandlerOption that sets the base context for all invocations of the handler. |
| 41 | func WithContext(ctx context.Context) Option { |
| 42 | return Option(func(h *handlerOptions) { |
| 43 | h.baseContext = ctx |
| 44 | }) |
| 45 | } |
| 46 | |
| 47 | // WithContextValue adds a value to the handler context. |
| 48 | // If a base context was set using WithContext, that base is used as the parent. |
searching dependent graphs…