ctxt

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ctxt provides a way to store and retrieve values from a context using the type of the value as a key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From[T any](ctx context.Context) (T, bool)

From returns the value associated with the wanted type.

func MustFrom

func MustFrom[T any](ctx context.Context) T

func With

func With[T any](ctx context.Context, v T) context.Context

With returns a copy of parent that contains the given value which can be retrieved by calling From with the resulting context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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