InMemoryBlobRepository class

In-memory implementation of IBlobRepository.

Stores blobs in memory using nested maps. Suitable for testing and development scenarios where persistence is not required.

Implemented types

Constructors

InMemoryBlobRepository({int? maxBlobBytes, int readChunkBytes = _defaultReadChunkBytes, Clock? clock})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

collectionSize(String collection) Future<int?>
Total size in bytes of every blob in the collection, or null when this backend cannot answer without walking the whole store.
override
deleteBlob(String collection, String id, {int? expectedVersion}) Future<bool>
Delete a blob; returns true when something was removed.
override
deleteCollection(String collection) Future<bool>
Drop an entire collection (namespace) and all blobs within it.
override
deleteMany(String collection, List<String> ids) Future<Set<String>>
Remove several blobs from one collection in as few round trips as the backend allows.
override
dispose() Future<void>
override
ensureCollection(String collection) Future<void>
Create the collection if it does not exist yet.
override
headBlob(String collection, String id) Future<BlobDescriptor?>
Fetch blob metadata; return null when missing.
override
headMany(String collection, List<String> ids) Future<Map<String, BlobDescriptor>>
Metadata for several blobs of one collection, keyed by id. Ids that are not there are simply absent from the result.
override
listBlobs(ListBlobsRequest request) Future<ListBlobsResponse>
List blob descriptors with pagination.
override
listCollections() Future<List<String>>
List known collections in the backing store.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readBlob(BlobReadRequest request) Future<BlobReadResult?>
Stream blob bytes; return null when missing.
override
toString() String
A string representation of this object.
inherited
writeBlob(BlobWriteRequest request) Future<BlobWriteResult>
Write blob from a byte stream; should enforce optimistic versioning when expectedVersion is provided in the request.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited