khictx

package
v0.52.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValue

func GetValue[T any](ctx context.Context, key typedmap.TypedKey[T]) (T, error)

GetValue retrieves a typed value from the context. Returns error if the value doesn't exist or can't be converted to type T.

func MustGetValue

func MustGetValue[T any](ctx context.Context, key typedmap.TypedKey[T]) T

MustGetValue retrieves a typed value from the context. Panics if the value doesn't exist or can't be converted to type T.

func WithValue

func WithValue[T any](ctx context.Context, key typedmap.TypedKey[T], value T) context.Context

WithValue returns a new context with the provided value stored under the given key. Warns when nil pointer values are stored as this may be confused with "not found" cases.

Types

This section is empty.

Jump to

Keyboard shortcuts

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