functions
- transaction_middleware.functions.get_transaction_id(create_if_missing: bool = True, header_name: str = 'X-Transaction-ID', generator: ~typing.Callable[[], str] = <function <lambda>>) str
Get the transaction ID from the request headers or generate a new one.
- Args:
create_if_missing (bool, optional): If True, generates a new transaction ID if not found in the request headers. Defaults to True. header_name (str, optional): Name of the header to look for the transaction ID. Defaults to settings.TRANSACTION_MIDDLEWARE_HEADER. generator (Callable[[], str], optional): Function to generate a new transaction ID. Defaults to lambda: str(Ksuid()).
- Raises:
HTTPException: _description_
- Returns:
str: _description_