context

package
v0.0.0-...-210f5be Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValue

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

GetValue returns result with key

func GetValueBool

func GetValueBool(ctx context.Context, key types.ContextKey) bool

GetValueBool returns bool result with key if type is not bool or not exist, return false

func GetValueInt64

func GetValueInt64(ctx context.Context, key types.ContextKey) int64

GetValueInt64 returns int64 result with key if type is not int64 or not exist, return 0

func GetValueString

func GetValueString(ctx context.Context, key types.ContextKey) string

GetValueString returns string result with key if type is not string or not exist, return ""

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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