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.
Internal call graph ▹
Internal call graph ▾
In the call graph viewer below, each node is a function belonging to this package and its children are the functions it calls—perhaps dynamically.
The root nodes are the entry points of the package: functions that may be called from outside the package. There may be non-exported or anonymous functions among them if they are called dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring
Functions may be omitted if they were determined to be unreachable in the particular programs or tests that were analyzed.
func DecodeKeyValue ¶
func DecodeKeyValue(k, v string) (string, string, error)
DecodeKeyValue returns k, v, nil. It is deprecated and should not be used.
func NewContext ¶
func NewContext(ctx context.Context, md MD) context.Context
NewContext is a wrapper for NewOutgoingContext(ctx, md). Deprecated.
func NewIncomingContext ¶
func NewIncomingContext(ctx context.Context, md MD) context.Context
NewIncomingContext creates a new context with incoming md attached.
func NewOutgoingContext ¶
func NewOutgoingContext(ctx context.Context, md MD) context.Context
NewOutgoingContext creates a new context with outgoing md attached.
MD is a mapping from metadata keys to values. Users should use the following two convenience functions New and Pairs to generate MD.
type MD map[string]string
func FromContext ¶
func FromContext(ctx context.Context) (md MD, ok bool)
FromContext is a wrapper for FromIncomingContext(ctx). Deprecated.
func FromIncomingContext ¶
func FromIncomingContext(ctx context.Context) (md MD, ok bool)
FromIncomingContext returns the incoming metadata in ctx if it exists. The returned MD should not be modified. Writing to it may cause races. Modification should be made to copies of the returned MD.
func FromOutgoingContext ¶
func FromOutgoingContext(ctx context.Context) (md MD, ok bool)
FromOutgoingContext returns the outgoing metadata in ctx if it exists. The returned MD should not be modified. Writing to it may cause races. Modification should be made to the copies of the returned MD.
func Join(mds ...MD) MD
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(m map[string]string) MD
New creates an MD from a given key-value map. Keys are automatically converted to lowercase.
func Pairs(kv ...string) MD
Pairs returns an MD formed by the mapping of key, value ... Pairs panics if len(kv) is odd. Keys are automatically converted to lowercase.
func (md MD) Copy() MD
Copy returns a copy of md.
func (md MD) Len() int
Len returns the number of items in md.