cattle_grid.dependencies
cattle_grid.dependencies
Dependencies injected by fast_depends
AccountExchange
module-attribute
AccountExchange = Annotated[
RabbitExchange, Depends(get_account_exchange)
]
The account exchange
ActivityExchange
module-attribute
ActivityExchange = Annotated[
RabbitExchange, Depends(get_exchange)
]
The activity exchange
ClientSession
module-attribute
ClientSession = Annotated[
ClientSession, Depends(get_client_session)
]
The aiohttp.ClientSession used by the application
CommittingSession
module-attribute
Session that commits the transaction
CorrelationId
module-attribute
The correlation id of the message
InternalExchange
module-attribute
InternalExchange = Annotated[
RabbitExchange, Depends(get_internal_exchange)
]
The interal activity exchange
LookupAnnotation
module-attribute
LookupAnnotation = Annotated[
LookupMethod, Depends(get_lookup)
]
The lookup method loaded from extensions
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
Returns the SqlAlchemy AsyncEngine
SqlSession
module-attribute
SQL session that does not commit afterwards
Transformer
module-attribute
The transformer loaded from extensions
fastapi
ActivityExchange
module-attribute
ActivityExchange = Annotated[
RabbitExchange, Depends(get_exchange)
]
The Activity Exchange
CommittingSqlSession
module-attribute
CommittingSqlSession = Annotated[
AsyncSession, Depends(with_committing_sql_session)
]
Session annotation to be used with FastAPI. A commit is performed, after processing the request
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
globals
GlobalContainer
dataclass
GlobalContainer(session: aiohttp.client.ClientSession | None = None, engine: sqlalchemy.ext.asyncio.engine.AsyncEngine | None = None, method_information: Optional[List[cattle_grid.model.extension.MethodInformationModel]] = None, transformer: Optional[Callable[[Dict], Awaitable[Dict]]] = None, lookup: Optional[Callable[[cattle_grid.model.lookup.Lookup], Awaitable[cattle_grid.model.lookup.Lookup]]] = None, _config: dynaconf.base.LazySettings | dynaconf.utils.DynaconfDict | None = None, async_session_maker: Optional[Callable[[], sqlalchemy.ext.asyncio.session.AsyncSession]] = None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
ClientSession | None
|
|
None
|
engine
|
AsyncEngine | None
|
|
None
|
method_information
|
List[MethodInformationModel] | None
|
|
None
|
transformer
|
Callable[list, Awaitable[Dict]] | None
|
|
None
|
lookup
|
Callable[list, Awaitable[Lookup]] | None
|
|
None
|
_config
|
LazySettings | DynaconfDict | None
|
|
None
|
async_session_maker
|
Callable[list, AsyncSession] | None
|
|
None
|
Source code in cattle_grid/dependencies/globals.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
account_exchange
cached
property
account_exchange: RabbitExchange
Returns the exchange used to distribute messages between accounts
Returns:
Type | Description |
---|---|
RabbitExchange
|
|
exchange
cached
property
exchange: RabbitExchange
internal_exchange
cached
property
internal_exchange: RabbitExchange
The internal exchange used to process ActivityPub messages related to the social graph
Returns:
Type | Description |
---|---|
RabbitExchange
|
|
alchemy_database
async
Initializes the sql alchemy engine
Source code in cattle_grid/dependencies/globals.py
processing
ActorProfile
module-attribute
Returns the actor profile of the actor processing the message
FactoriesForActor
module-attribute
FactoriesForActor = Annotated[
tuple[ActivityFactory, ObjectFactory],
Depends(get_factories_for_actor),
]
Returns the activity and object factories for the actor