Context Module API Reference¶
This section documents the internals of the context
module in Bijux CLI.
bijux_cli.contracts.context ¶
Defines the contract for the request-scoped context service.
This module specifies the ContextProtocol
, a formal interface for services that manage contextual data associated with a specific operation or request. This pattern allows for state to be carried implicitly through an application's call stack.
ContextProtocol ¶
Bases: Protocol
Defines the contract for a request-scoped context object.
This interface specifies methods for a context that can store arbitrary key-value data and supports both synchronous (with
) and asynchronous (async with
) context management patterns.
clear ¶
get ¶
Retrieves a value by key from the context.
Parameters:
-
key
(str
) –The key of the value to retrieve.
Returns:
-
Any
(Any
) –The value associated with the key.
set ¶
Sets a key-value pair in the context.
Parameters:
-
key
(str
) –The key to set.
-
value
(Any
) –The value to associate with the key.
Returns:
-
None
(None
) –