metadata

package
v1.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2019 License: Apache-2.0 Imports: 1 Imported by: 1,179

Documentation

Overview

Package metadata is a way of defining message headers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeContext added in v1.15.0

func MergeContext(ctx context.Context, patchMd Metadata, overwrite bool) context.Context

MergeContext merges metadata to existing metadata, overwriting if specified

func NewContext

func NewContext(ctx context.Context, md Metadata) context.Context

NewContext creates a new context with the given metadata

Types

type Metadata

type Metadata map[string]string

Metadata is our way of representing request headers internally. They're used at the RPC level and translate back and forth from Transport headers.

func Copy added in v0.21.0

func Copy(md Metadata) Metadata

Copy makes a copy of the metadata

func FromContext

func FromContext(ctx context.Context) (Metadata, bool)

FromContext returns metadata from the given context

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL