swh.objstorage.backends.seaweedfs.objstorage module#

class swh.objstorage.backends.seaweedfs.objstorage.SeaweedFilerObjStorage(*, url: str = '', compression: Literal['bz2', 'lzma', 'gzip', 'zlib', 'none'] = 'none', slicing: str = '', pool_maxsize: int = 100, **kwargs)[source]#

Bases: ObjStorage

ObjStorage with seaweedfs abilities, using the Filer API.

chrislusf/seaweedfs

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

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

check_config(*, check_write)[source]#

Check the configuration for this object storage

add(content: bytes, obj_id: bytes | CompositeObjId, check_presence: bool = True) None[source]#
restore(content: bytes, obj_id: bytes | CompositeObjId) None[source]#
get(obj_id: bytes | CompositeObjId) bytes[source]#
download_url(obj_id: bytes | CompositeObjId, content_disposition: str | None = None, expiry: timedelta | None = None) str | None[source]#
delete(obj_id: bytes | CompositeObjId)[source]#
list_content(last_obj_id: bytes | CompositeObjId | None = None, limit: int | None = 10000) Iterator[CompositeObjId][source]#