Documentation
¶
Index ¶
- Constants
- Variables
- func GetDebugMode(ctx context.Context) (bool, error)
- func GetFromContext(ctx context.Context, key string) (any, error)
- func PutToContext(ctx context.Context, key string, value any) (context.Context, error)
- func SetDebugMode(ctx context.Context, debugMode bool) (context.Context, error)
Constants ¶
View Source
const (
ContextKeyDebugMode string = "_DI_FLG_DEBUG"
)
Variables ¶
View Source
var (
ErrKeyNotFound = errors.Base("value map key not found")
)
Functions ¶
func GetDebugMode ¶ added in v1.0.6
Get the debug mode flag from the DI context.
func GetFromContext ¶
Get a value from a context.
Will signal `contextext.ErrInvalidContext` if the context is not valid. Will signal `contextext.ErrValueMapNotFound` if there is no value map. Will signal `ErrKeyNotFound` if the value map does not contain the key.
func PutToContext ¶
Place a value in a context.
If there is no value map in the context then one will be created.
Returns a new context with the value map.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.