package metadata
import "google.golang.org/grpc/metadata"
Package metadata define the structure of the metadata supported by gRPC library.
Index ¶
- func DecodeKeyValue(k, v string) (string, string, error)
- func NewContext(ctx context.Context, md MD) context.Context
- type MD
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.
func NewContext ¶
NewContext creates a new context with md attached.
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.
func New ¶
New creates a MD from given key-value map.
func Pairs ¶
Pairs returns an MD formed by the mapping of key, value ... Pairs panics if len(kv) is odd.
func (MD) Copy ¶
Copy returns a copy of md.
func (MD) Len ¶
Len returns the number of items in md.
Source Files ¶
metadata.go
- Version
- v1.0.1-GA
- Published
- Aug 19, 2016
- Platform
- darwin/amd64
- Imports
- 4 packages
- Last checked
- 3 hours ago –
Tools for package owners.