Documentation
¶
Overview ¶
lazycontext provides acumulative context that can store values like context.Context or by type
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Set ¶
func Set[T any](ctx AppContext, value T)
Set stores a value in the context using the type of the value as the key
Types ¶
type AppContext ¶
type AppContext interface {
context.Context
AddValue(key any, value any) AppContext
}
AppContext is a small wrapper around the context.AppContext type that provides a more convenient API
func FromContext ¶
func FromContext(ctx context.Context) (AppContext, bool)
FromContext retrieves the Context from a context.Context
func NewWithContext ¶
func NewWithContext(ctx context.Context) AppContext
NewWithContext creates a new Context from a context.Context
Click to show internal directories.
Click to hide internal directories.