HTTPPattern returns the HTTP path pattern struct relating to the HTTP handler, if one exists.
(ctx context.Context)
| 408 | |
| 409 | // HTTPPattern returns the HTTP path pattern struct relating to the HTTP handler, if one exists. |
| 410 | func HTTPPattern(ctx context.Context) (Pattern, bool) { |
| 411 | v, ok := ctx.Value(httpPatternKey{}).(Pattern) |
| 412 | return v, ok |
| 413 | } |
| 414 | |
| 415 | func withHTTPPattern(ctx context.Context, httpPattern Pattern) context.Context { |
| 416 | return context.WithValue(ctx, httpPatternKey{}, httpPattern) |
no outgoing calls