Documentation ¶
Overview ¶
Package metadata define the structure of the metadata supported by gRPC library. Please refer to http://www.grpc.io/docs/guides/wire.html for more information about custom-metadata.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeKeyValue ¶
DecodeKeyValue returns the original key and value corresponding to the encoded data in k, v. If k is a binary header and v contains comma, v is split on comma before decoded, and the decoded v will be joined with comma before returned.
Types ¶
type MD ¶
MD is a mapping from metadata keys to values. Users should use the following two convenience functions New and Pairs to generate MD.
func FromContext ¶
FromContext returns the MD in ctx if it exists. The returned md should be immutable, writing to it may cause races. Modification should be made to the copies of the returned md.
func Join ¶ added in v1.0.2
Join joins any number of MDs into a single MD. The order of values for each key is determined by the order in which the MDs containing those values are presented to Join.
func New ¶
New creates a MD from given key-value map. Keys are automatically converted to lowercase. And for keys having "-bin" as suffix, their values will be applied Base64 encoding.