minos.aggregate.transactions.repositories.memory module¶
- class minos.aggregate.transactions.repositories.memory.InMemoryTransactionRepository(*args, **kwargs)[source]¶
Bases:
minos.aggregate.transactions.repositories.abc.TransactionRepository
In Memory Transaction Repository class.
- property already_destroyed: bool¶
Already Destroy getter.
- Return type
bool
- Returns
A boolean value.
- property already_setup: bool¶
Already Setup getter.
- Return type
bool
- Returns
A boolean value.
- async destroy()¶
Destroy miscellaneous repository things.
- Return type
None
- Returns
This method does not return anything.
- classmethod from_config(config=None, **kwargs)¶
Build a new instance from config.
- Parameters
config (
typing.Union
[minos.common.configuration.config.MinosConfig
,pathlib.Path
,None
]) – Config instance. If None is provided, default config is chosen.kwargs – Additional named arguments.
- Return type
~S
- Returns
A instance of the called class.
- async get(uuid, **kwargs)¶
Get a
TransactionEntry
from its identifier.- Parameters
uuid (
uuid.UUID
) – Identifier of theAggregate
.kwargs – Additional named arguments.
- Return type
- Returns
The
TransactionEntry
instance.
- async select(uuid=None, uuid_ne=None, uuid_in=None, destination_uuid=None, status=None, status_in=None, event_offset=None, event_offset_lt=None, event_offset_gt=None, event_offset_le=None, event_offset_ge=None, updated_at=None, updated_at_lt=None, updated_at_gt=None, updated_at_le=None, updated_at_ge=None, **kwargs)¶
Get a transaction from the repository.
- Parameters
uuid (
typing.Optional
[uuid.UUID
]) – Transaction identifier equal to the given value.uuid_ne (
typing.Optional
[uuid.UUID
]) – Transaction identifier not equal to the given valueuuid_in (
typing.Optional
[tuple
[uuid.UUID
, …]]) – Transaction identifier within the given values.destination_uuid (
typing.Optional
[uuid.UUID
]) – Destination Transaction identifier equal to the given value.status (
typing.Optional
[minos.aggregate.transactions.entries.TransactionStatus
]) – Transaction status equal to the given value.status_in (
typing.Optional
[tuple
[str
, …]]) – Transaction status within the given valuesevent_offset (
typing.Optional
[int
]) – Event offset equal to the given value.event_offset_lt (
typing.Optional
[int
]) – Event Offset lower than the given valueevent_offset_gt (
typing.Optional
[int
]) – Event Offset greater than the given valueevent_offset_le (
typing.Optional
[int
]) – Event Offset lower or equal to the given valueevent_offset_ge (
typing.Optional
[int
]) – Event Offset greater or equal to the given valueupdated_at (
typing.Optional
[datetime.datetime
]) – Updated at equal to the given value.updated_at_lt (
typing.Optional
[datetime.datetime
]) – Updated at lower than the given value.updated_at_gt (
typing.Optional
[datetime.datetime
]) – Updated at greater than the given value.updated_at_le (
typing.Optional
[datetime.datetime
]) – Updated at lower or equal to the given value.updated_at_ge (
typing.Optional
[datetime.datetime
]) – Updated at greater or equal to the given value.kwargs – Additional named arguments.
- Return type
typing.AsyncIterator
[minos.aggregate.transactions.entries.TransactionEntry
]- Returns
An asynchronous iterator.
- async setup()¶
Setup miscellaneous repository things.
- Return type
None
- Returns
This method does not return anything.
- async submit(transaction)¶
Submit a new or updated transaction to store it on the repository.
- Parameters
transaction (
minos.aggregate.transactions.entries.TransactionEntry
) – The transaction to be stored.- Return type
- Returns
This method does not return anything.
- write_lock()¶
Get a write lock.
- Return type
minos.common.locks.Lock
- Returns
An asynchronous context manager.