memory
Classes:
-
MemoryStorage–A storage backend for testing that saves data to local files.
Attributes:
-
memory_storage–Default instance of MemoryStorage for testing purposes.
memory_storage
module-attribute
memory_storage = MemoryStorage()
Default instance of MemoryStorage for testing purposes.
MemoryStorage
MemoryStorage(chunk_size: int = 5 * 1024 ** 2)
A storage backend for testing that saves data to local files.
Methods:
-
deserialize_config–Deserialize the configuration from a JSON string.
-
read_data–Load data from the given location.
-
read_data_stream–Load a stream of data from the given location.
-
serialize_config–Serialize the configuration to a JSON string.
-
write_data–Save the given data.
-
write_data_stream–Save the given data stream.
deserialize_config
deserialize_config(config: str) -> C
Deserialize the configuration from a JSON string.
read_data_stream
async
read_data_stream(location: str) -> AsyncGenerator[bytes]
Load a stream of data from the given location.
write_data
async
Save the given data.
write_data_stream
async
write_data_stream(
data_stream: AsyncIterable[bytes],
get_digest: GetStreamDigest,
_tags: TagMap,
) -> str
Save the given data stream.