gufo.blob.aio.memory¶
MemoryBlob implementation.
MemoryBlob
¶
Bases: BlobBase
In-memory implementation of Blob storage.
Stores all objects in process memory with optional limits
- max_objects: maximum number of keys allowed
- max_size: maximum total size of all stored values in bytes
max_objects
property
¶
Maximum number of objects allowed in the blob store.
If set to None, the number of objects is unlimited.
Returns:
| Type | Description |
|---|---|
int | None
|
Maximum number of stored keys or None if unlimited. |
max_size
property
¶
Maximum total size of all stored values in bytes.
If set to None, total storage size is unlimited.
Returns:
| Type | Description |
|---|---|
int | None
|
Maximum total size in bytes or None if unlimited. |
delete(key)
async
¶
Delete key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Object key. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the key does not exist. |
BlobError
|
On backend or I/O failure. |
exists(key)
async
¶
Check whether a key exists in the blob store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Object key. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the key exists, False otherwise. |
Raises:
| Type | Description |
|---|---|
BlobError
|
On backend or I/O failure. |
get(key)
async
¶
Retrieve data by key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Object key. |
required |
Raises:
| Type | Description |
|---|---|
BlobError
|
On backend or I/O failure. |
parse_url(url)
classmethod
¶
Parse URL and extract parameters for constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
URL to parse. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
|