aea.helpers.storage.generic_
storage
This module contains the storage implementation.
AsyncCollection Objects
Async collection.
__
init__
Init collection object.
Arguments:
storage_backend
: storage backed to use.collection_name
: str
put
Put object into collection.
Arguments:
object_id
: str object idobject_body
: python dict, json compatible.
Returns:
None
get
Get object from the collection.
Arguments:
object_id
: str object id
Returns:
dict if object exists in collection otherwise None
remove
Remove object from the collection.
Arguments:
object_id
: str object id
Returns:
None
find
Get objects from the collection by filtering by field value.
Arguments:
field
: field name to search: example "parent.field"equals
: value field should be equal to
Returns:
None
list
List all objects with keys from the collection.
Returns:
Tuple of objects keys, bodies.
SyncCollection Objects
Async collection.
__
init__
Init collection object.
Arguments:
async_collection_coro
: coroutine returns async collection.loop
: abstract event loop where storage is running.
put
Put object into collection.
Arguments:
object_id
: str object idobject_body
: python dict, json compatible.
Returns:
None
get
Get object from the collection.
Arguments:
object_id
: str object id
Returns:
dict if object exists in collection otherwise None
remove
Remove object from the collection.
Arguments:
object_id
: str object id
Returns:
None
find
Get objects from the collection by filtering by field value.
Arguments:
field
: field name to search: example "parent.field"equals
: value field should be equal to
Returns:
List of object bodies
list
List all objects with keys from the collection.
Returns:
Tuple of objects keys, bodies.
Storage Objects
Generic storage.
__
init__
| __init__(storage_uri: str, loop: asyncio.AbstractEventLoop = None, threaded: bool = False) -> None
Init storage.
Arguments:
storage_uri
: configuration string for storage.loop
: asyncio event loop to use.threaded
: bool. start in thread if True.
wait_
connected
Wait generic storage is connected.
is_
connected
Get running state of the storage.
run
Connect storage.
get_
collection
Get async collection.
get_
sync_
collection
Get sync collection.
__
repr__
Get string representation of the storage.