context

package
v0.0.0-...-e3e1183 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(parent context.Context) context.Context

Clone copy the origin mosn value context(if it is), and return new one

func Get

func Get(ctx context.Context, key types.ContextKey) interface{}

func WithValue

func WithValue(parent context.Context, key types.ContextKey, value interface{}) context.Context

WithValue add the given key-value pair into the existed value context, or create a new value context contains the pair. This Function should not be used along the official context.WithValue !! The following context topology will leads to existed pair {'foo':'bar'} NOT FOUND, cause recursive lookup for key-type=ContextKey is not supported by mosn.valueCtx.

topology: context.Background -> mosn.valueCtx{'foo':'bar'} -> context.valueCtx -> mosn.valueCtx{'hmm':'haa'}

Types

This section is empty.

Jump to

Keyboard shortcuts

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