kubernetes/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go

const MetadataHeaderPrefix

const MetadataPrefix

const MetadataTrailerPrefix

const metadataGrpcTimeout

const metadataHeaderBinarySuffix

const xForwardedFor

const xForwardedHost

var DefaultContextTimeout

var malformedHTTPHeaders

type rpcMethodKey

type httpPathPatternKey

type AnnotateContextOption

func WithHTTPPathPattern(pattern string) AnnotateContextOption {}

func decodeBinHeader(v string) ([]byte, error) {}

/*
AnnotateContext adds context information such as metadata from the request.

At a minimum, the RemoteAddr is included in the fashion of "X-Forwarded-For",
except that the forwarded destination is not another HTTP service but rather
a gRPC service.
*/
func AnnotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcMethodName string, options ...AnnotateContextOption) (context.Context, error) {}

// AnnotateIncomingContext adds context information such as metadata from the request.
// Attach metadata as incoming context.
func AnnotateIncomingContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcMethodName string, options ...AnnotateContextOption) (context.Context, error) {}

func isValidGRPCMetadataKey(key string) bool {}

func isValidGRPCMetadataTextValue(textValue string) bool {}

func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcMethodName string, options ...AnnotateContextOption) (context.Context, metadata.MD, error) {}

type ServerMetadata

type serverMetadataKey

// NewServerMetadataContext creates a new context with ServerMetadata
func NewServerMetadataContext(ctx context.Context, md ServerMetadata) context.Context {}

// ServerMetadataFromContext returns the ServerMetadata in ctx
func ServerMetadataFromContext(ctx context.Context) (md ServerMetadata, ok bool) {}

type ServerTransportStream

// Method returns the method for the stream.
func (s *ServerTransportStream) Method() string {}

// Header returns the header metadata of the stream.
func (s *ServerTransportStream) Header() metadata.MD {}

// SetHeader sets the header metadata.
func (s *ServerTransportStream) SetHeader(md metadata.MD) error {}

// SendHeader sets the header metadata.
func (s *ServerTransportStream) SendHeader(md metadata.MD) error {}

// Trailer returns the cached trailer metadata.
func (s *ServerTransportStream) Trailer() metadata.MD {}

// SetTrailer sets the trailer metadata.
func (s *ServerTransportStream) SetTrailer(md metadata.MD) error {}

func timeoutDecode(s string) (time.Duration, error) {}

func timeoutUnitToDuration(u uint8) (d time.Duration, ok bool) {}

// isPermanentHTTPHeader checks whether hdr belongs to the list of
// permanent request headers maintained by IANA.
// http://www.iana.org/assignments/message-headers/message-headers.xml
func isPermanentHTTPHeader(hdr string) bool {}

// isMalformedHTTPHeader checks whether header belongs to the list of
// "malformed headers" and would be rejected by the gRPC server.
func isMalformedHTTPHeader(header string) bool {}

// RPCMethod returns the method string for the server context. The returned
// string is in the format of "/package.service/method".
func RPCMethod(ctx context.Context) (string, bool) {}

func withRPCMethod(ctx context.Context, rpcMethodName string) context.Context {}

// HTTPPathPattern returns the HTTP path pattern string relating to the HTTP handler, if one exists.
// The format of the returned string is defined by the google.api.http path template type.
func HTTPPathPattern(ctx context.Context) (string, bool) {}

func withHTTPPathPattern(ctx context.Context, httpPathPattern string) context.Context {}