forked from toolshed/abra
chore: make deps, go mod vendor
This commit is contained in:
11
vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go
generated
vendored
11
vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go
generated
vendored
@ -49,6 +49,7 @@ var malformedHTTPHeaders = map[string]struct{}{
|
||||
type (
|
||||
rpcMethodKey struct{}
|
||||
httpPathPatternKey struct{}
|
||||
httpPatternKey struct{}
|
||||
|
||||
AnnotateContextOption func(ctx context.Context) context.Context
|
||||
)
|
||||
@ -404,3 +405,13 @@ func HTTPPathPattern(ctx context.Context) (string, bool) {
|
||||
func withHTTPPathPattern(ctx context.Context, httpPathPattern string) context.Context {
|
||||
return context.WithValue(ctx, httpPathPatternKey{}, httpPathPattern)
|
||||
}
|
||||
|
||||
// HTTPPattern returns the HTTP path pattern struct relating to the HTTP handler, if one exists.
|
||||
func HTTPPattern(ctx context.Context) (Pattern, bool) {
|
||||
v, ok := ctx.Value(httpPatternKey{}).(Pattern)
|
||||
return v, ok
|
||||
}
|
||||
|
||||
func withHTTPPattern(ctx context.Context, httpPattern Pattern) context.Context {
|
||||
return context.WithValue(ctx, httpPatternKey{}, httpPattern)
|
||||
}
|
||||
|
Reference in New Issue
Block a user