context

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Overview

nolint

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 Key) interface{}

Get is a wrapper for context.Value

func WithValue

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

WithValue add the given key-value pair into the existed value context, or create a new value context which contains the pair.

Types

type Key

type Key int

ContextKey type

const (
	KeyBufferPoolCtx Key = iota
	KeyVariables
	KeyEnd
)

Context key types(built-in)

Jump to

Keyboard shortcuts

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