.exchange
cattle_grid.exchange
create_router(main_exchange=exchange(), include_shovels=True)
Creates a router to be used to manage users
Source code in cattle_grid/exchange/__init__.py
handlers
delete_actor_handler(msg, broker)
async
Deletes the actor by id. Should be used asynchronously.
Source code in cattle_grid/exchange/handlers.py
update_actor(msg, broker=Context())
async
Should be used asynchronously
Source code in cattle_grid/exchange/handlers.py
message_handlers
send_message(msg, broker=Context())
async
Takes a message and ensure it is distributed appropriatelty
Source code in cattle_grid/exchange/message_handlers.py
server
create_exchange_api_router(config)
Creates a API Router for HTTP methods of the gateway. One should note that these mostly exist to fulfill secondary concerns of the gateway. Most of the work is done by the router.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
LazySettings
|
|
required |
Returns:
Type | Description |
---|---|
APIRouter
|
|
Source code in cattle_grid/exchange/server/__init__.py
shovel
should_shovel_activity(activity)
async
Some activities like Block or Undo Block should not be visible to the user. This method returns False if this is the case.
Source code in cattle_grid/exchange/shovel.py
test_actor_update
create_actor(base_url, preferred_username=None, identifiers={}, profile={})
async
Creates a new actor in the database
Source code in cattle_grid/activity_pub/actor.py
database()
async
new_auth_config(actor_id, username=None)
Creates a new authorization configuration
Source code in cattle_grid/config/auth.py
save_auth_config(filename, config)
Saves the authorization configuration to a file
test_actor()
async
with_database(db_uri='sqlite://:memory:', generate_schemas=False)
async
Opens the connection to the database using tortoise
Source code in cattle_grid/database.py
test_handlers
create_actor(base_url, preferred_username=None, identifiers={}, profile={})
async
Creates a new actor in the database
Source code in cattle_grid/activity_pub/actor.py
database()
async
new_auth_config(actor_id, username=None)
Creates a new authorization configuration
Source code in cattle_grid/config/auth.py
save_auth_config(filename, config)
Saves the authorization configuration to a file
test_actor()
async
with_database(db_uri='sqlite://:memory:', generate_schemas=False)
async
Opens the connection to the database using tortoise