swh.fuse.backends package#
Submodules#
Module contents#
FUSE backends#
These classes are abstraction layers to the archive’s graph and object storage.
- class swh.fuse.backends.GraphBackend[source]#
Bases:
ABC
Methods required by the FUSE logic to create its folders layout. Those methods must return dicts compliant with the Web API, to ease their use and caching in the
swh.fuse.fuse.Fuse
class. Fields listed in method specifications below are the minimal required fields. At worst, set them toNone
(because this is better supported byswh-web-client
’stypify_json
). Additional fields will be included in the various meta.json files proposed by this virtual file system.- abstract async get_metadata(swhid: CoreSWHID) Dict | List [source]#
Entries in the returned
dict
depend on theswhid
type.For
cnt
, return a dict containing at least'length': [int]
For
dir
, return a list of entries like{ "dir_id": "dir's hash", "name": "dir item name", "type": "str=dir|file|rev", # yes, `file`... "target": "target hash", "perms": "permissions [int]", # if target is a cnt: "length": "file size [int]", }
For
rev
, return a dict containing at leastdirectory
(SWHID),parents
(list of objects containing at listid
(hash)),date
(str, isoformat),committer_date
(str, isoformat), id` (object’s hash).For
rel
, return a dict containing at leasttarget
(SWHID),target_type
,date
(str, isoformat),id
(object’s hash).For
snp
, return a dict where each key is a branch name, each value is a dict containing at leasttarget
(hash),target_type
(content, directory, revision, release, snapshot or alias).