Skip to main content

Module metadata

Module metadata 

Source
Expand description

HTTP header <-> gRPC metadata conversion, protobuf metadata <-> gRPC metadata conversion, and grpc-timeout parsing. Shared by the proxy and the native server library.

Functions§

format_grpc_timeout
Build a grpc-timeout header value from a Duration (millisecond unit).
grpc_timeout_from_millis
Convert a Subscribe.timeout_millis field (0 = no deadline) to a Duration.
is_denied
merge_metadata_into_headers
Merge gRPC metadata into HTTP headers, skipping the denylist.
metadata_to_vec
Convert a gRPC metadata map into a protobuf metadata list for a frame — the inverse of metadata_vec_to_metadata, so a -bin value is base64-decoded back to raw bytes.
metadata_vec_to_metadata
Convert a protobuf metadata list (from a frame) into a gRPC metadata map.
parse_grpc_timeout
Parse a gRPC grpc-timeout header (e.g. 100m, 5S) into a Duration.
percent_decode
Minimal gRPC grpc-message percent-decoding (%XX).
percent_encode
Minimal percent-encoding for a grpc-message header value.
read_status
Read the gRPC status (code, message) from a response’s trailers, falling back to its headers (a “trailers-only” response carries the status in the headers). The grpc-message value is percent-decoded.
request_headers_to_metadata
Copy request headers into a gRPC metadata map, minus the denylist.