baggage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) transport.Headers

FromContext returns all baggage attached to the given context as a header map, or nil if no baggage is attached to it.

func Get

func Get(ctx context.Context, key string) (value string, ok bool)

Get returns the baggage value attached to the context with the given key.

func NewContext

func NewContext(ctx context.Context, key, value string) context.Context

NewContext returns a copy of the context with the given key-value pair attached to it.

The parent context's baggage is left intact.

func NewContextWithHeaders

func NewContextWithHeaders(ctx context.Context, headers map[string]string) context.Context

NewContextWithHeaders is similar to NewContext except it attaches all elements in the given headers map to the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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