swh.objstorage.backends.in_memory module#

class swh.objstorage.backends.in_memory.InMemoryObjStorage(**kwargs)[source]#

Bases: ObjStorage

In-Memory objstorage.

Intended for test purposes.

PRIMARY_HASH: Literal['sha1', 'sha256'] = 'sha1'#
name: str = 'memory'#

Default objstorage name; can be overloaded at instantiation time giving a ‘name’ argument to the constructor

check_config(*, check_write)[source]#
add(content: bytes, obj_id: bytes | CompositeObjId, check_presence: bool = True) None[source]#
get(obj_id: bytes | CompositeObjId) bytes[source]#
delete(obj_id: bytes | CompositeObjId)[source]#