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-timeoutheader value from a Duration (millisecond unit). - grpc_
timeout_ from_ millis - Convert a
Subscribe.timeout_millisfield (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-binvalue 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-timeoutheader (e.g.100m,5S) into a Duration. - percent_
decode - Minimal gRPC
grpc-messagepercent-decoding (%XX). - percent_
encode - Minimal percent-encoding for a
grpc-messageheader 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). Thegrpc-messagevalue is percent-decoded. - request_
headers_ to_ metadata - Copy request headers into a gRPC metadata map, minus the denylist.