cattle_grid.dependencies.fastapi ¶
FastAPI uses fastapi.Depends instead of fast_depends.Depends, so when building a fastapi.APIRouter, one needs to use dependencies using the former. These are provided in this package.
ActivityExchangePublisher
module-attribute
¶
Publisher to the activity exchange
ActivityExchangeRequester
module-attribute
¶
Requester to the activity exchange
ClientSession
module-attribute
¶
ClientSession = Annotated[
ClientSession, Depends(get_client_session)
]
The aiohttp.ClientSession used by the application
CommittingSession
module-attribute
¶
CommittingSession = Annotated[
AsyncSession, Depends(with_committing_sql_session)
]
Session annotation to be used with FastAPI. A commit is performed, after processing the request
Config
module-attribute
¶
Returns the configuration
MethodInformation
module-attribute
¶
MethodInformation = Annotated[
List[MethodInformationModel],
Depends(get_method_information),
]
Returns the information about the methods that are a part of the exchange
SqlAsyncEngine
module-attribute
¶
SqlAsyncEngine = Annotated[AsyncEngine, Depends(get_engine)]
Returns the SqlAlchemy AsyncEngine
SqlSession
module-attribute
¶
SqlSession = Annotated[
AsyncSession, Depends(with_fast_api_session)
]
Session annotation to be used with FastAPI