Skip to content

Commit

Permalink
feat(services/core): Implement stat_has_* and list_has_* correctly fo…
Browse files Browse the repository at this point in the history
…r services (#5472)
  • Loading branch information
geetanshjuneja authored Dec 30, 2024
1 parent 0536a0f commit 4e99afa
Show file tree
Hide file tree
Showing 42 changed files with 274 additions and 8 deletions.
5 changes: 5 additions & 0 deletions core/src/services/aliyun_drive/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ impl Access for AliyunDriveBackend {
list: true,
list_with_limit: true,
shared: true,
stat_has_content_length: true,
stat_has_content_type: true,
list_has_last_modified: true,
list_has_content_length: true,
list_has_content_type: true,
..Default::default()
});
am.into()
Expand Down
4 changes: 4 additions & 0 deletions core/src/services/alluxio/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ impl Access for AlluxioBackend {
list: true,

shared: true,
stat_has_content_length: true,
stat_has_last_modified: true,
list_has_content_length: true,
list_has_last_modified: true,

..Default::default()
});
Expand Down
14 changes: 14 additions & 0 deletions core/src/services/azblob/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,15 @@ impl Access for AzblobBackend {
stat: true,
stat_with_if_match: true,
stat_with_if_none_match: true,
stat_has_cache_control: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_content_encoding: true,
stat_has_content_range: true,
stat_has_etag: true,
stat_has_content_md5: true,
stat_has_last_modified: true,
stat_has_content_disposition: true,

read: true,

Expand All @@ -524,6 +533,11 @@ impl Access for AzblobBackend {

list: true,
list_with_recursive: true,
list_has_etag: true,
list_has_content_length: true,
list_has_content_md5: true,
list_has_content_type: true,
list_has_last_modified: true,

presign: self.has_sas_token,
presign_stat: self.has_sas_token,
Expand Down
12 changes: 12 additions & 0 deletions core/src/services/azdls/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,15 @@ impl Access for AzdlsBackend {
.set_name(&self.core.filesystem)
.set_native_capability(Capability {
stat: true,
stat_has_cache_control: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_content_encoding: true,
stat_has_content_range: true,
stat_has_etag: true,
stat_has_content_md5: true,
stat_has_last_modified: true,
stat_has_content_disposition: true,

read: true,

Expand All @@ -244,6 +253,9 @@ impl Access for AzdlsBackend {
rename: true,

list: true,
list_has_etag: true,
list_has_content_length: true,
list_has_last_modified: true,

shared: true,

Expand Down
12 changes: 12 additions & 0 deletions core/src/services/azfile/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ impl Access for AzfileBackend {
.set_root(&self.core.root)
.set_native_capability(Capability {
stat: true,
stat_has_cache_control: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_content_encoding: true,
stat_has_content_range: true,
stat_has_etag: true,
stat_has_content_md5: true,
stat_has_last_modified: true,
stat_has_content_disposition: true,

read: true,

Expand All @@ -255,6 +264,9 @@ impl Access for AzfileBackend {
rename: true,

list: true,
list_has_etag: true,
list_has_last_modified: true,
list_has_content_length: true,

shared: true,

Expand Down
6 changes: 6 additions & 0 deletions core/src/services/b2/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ impl Access for B2Backend {
.set_root(&self.core.root)
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_content_md5: true,
stat_has_content_type: true,

read: true,

Expand Down Expand Up @@ -256,6 +259,9 @@ impl Access for B2Backend {
list_with_limit: true,
list_with_start_after: true,
list_with_recursive: true,
list_has_content_length: true,
list_has_content_md5: true,
list_has_content_type: true,

presign: true,
presign_read: true,
Expand Down
4 changes: 4 additions & 0 deletions core/src/services/chainsafe/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ impl Access for ChainsafeBackend {
.set_root(&self.core.root)
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_content_type: true,

read: true,

Expand All @@ -189,6 +191,8 @@ impl Access for ChainsafeBackend {
delete: true,

list: true,
list_has_content_length: true,
list_has_content_type: true,

shared: true,

Expand Down
1 change: 1 addition & 0 deletions core/src/services/compfs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ impl Access for CompfsBackend {
.set_root(&self.core.root.to_string_lossy())
.set_native_capability(Capability {
stat: true,
stat_has_last_modified: true,

read: true,

Expand Down
10 changes: 10 additions & 0 deletions core/src/services/cos/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@ impl Access for CosBackend {
stat: true,
stat_with_if_match: true,
stat_with_if_none_match: true,
stat_has_cache_control: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_content_encoding: true,
stat_has_content_range: true,
stat_has_etag: true,
stat_has_content_md5: true,
stat_has_last_modified: true,
stat_has_content_disposition: true,

read: true,

Expand Down Expand Up @@ -281,6 +290,7 @@ impl Access for CosBackend {

list: true,
list_with_recursive: true,
list_has_content_length: true,

presign: true,
presign_stat: true,
Expand Down
11 changes: 11 additions & 0 deletions core/src/services/dbfs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,24 @@ impl Access for DbfsBackend {
.set_root(&self.core.root)
.set_native_capability(Capability {
stat: true,
stat_has_cache_control: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_content_encoding: true,
stat_has_content_range: true,
stat_has_etag: true,
stat_has_content_md5: true,
stat_has_last_modified: true,
stat_has_content_disposition: true,

write: true,
create_dir: true,
delete: true,
rename: true,

list: true,
list_has_last_modified: true,
list_has_content_length: true,

shared: true,

Expand Down
4 changes: 4 additions & 0 deletions core/src/services/dropbox/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ impl Access for DropboxBackend {
.set_root(&self.core.root)
.set_native_capability(Capability {
stat: true,
stat_has_last_modified: true,
stat_has_content_length: true,

read: true,

Expand All @@ -62,6 +64,8 @@ impl Access for DropboxBackend {

list: true,
list_with_recursive: true,
list_has_last_modified: true,
list_has_content_length: true,

copy: true,

Expand Down
2 changes: 2 additions & 0 deletions core/src/services/fs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ impl Access for FsBackend {
.set_root(&self.core.root.to_string_lossy())
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_last_modified: true,

read: true,

Expand Down
4 changes: 4 additions & 0 deletions core/src/services/ftp/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ impl Access for FtpBackend {
.set_root(&self.root)
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_last_modified: true,

read: true,

Expand All @@ -283,6 +285,8 @@ impl Access for FtpBackend {
create_dir: true,

list: true,
list_has_content_length: true,
list_has_last_modified: true,

shared: true,

Expand Down
11 changes: 11 additions & 0 deletions core/src/services/gcs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,12 @@ impl Access for GcsBackend {
stat: true,
stat_with_if_match: true,
stat_with_if_none_match: true,
stat_has_etag: true,
stat_has_content_md5: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_last_modified: true,
stat_has_user_metadata: true,

read: true,

Expand Down Expand Up @@ -392,6 +398,11 @@ impl Access for GcsBackend {
list_with_limit: true,
list_with_start_after: true,
list_with_recursive: true,
list_has_etag: true,
list_has_content_md5: true,
list_has_content_length: true,
list_has_content_type: true,
list_has_last_modified: true,

presign: true,
presign_stat: true,
Expand Down
2 changes: 2 additions & 0 deletions core/src/services/gdrive/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ impl Access for GdriveBackend {

list: true,
list_has_content_type: true,
list_has_content_length: true,
list_has_etag: true,

write: true,

Expand Down
10 changes: 10 additions & 0 deletions core/src/services/ghac/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ impl Access for GhacBackend {
.set_name(&self.version)
.set_native_capability(Capability {
stat: true,
stat_with_if_none_match: true,
stat_has_cache_control: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_content_encoding: true,
stat_has_content_range: true,
stat_has_etag: true,
stat_has_content_md5: true,
stat_has_last_modified: true,
stat_has_content_disposition: true,

read: true,

Expand Down
4 changes: 4 additions & 0 deletions core/src/services/github/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ impl Access for GithubBackend {
.set_root(&self.core.root)
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_etag: true,

read: true,

Expand All @@ -196,6 +198,8 @@ impl Access for GithubBackend {

list: true,
list_with_recursive: true,
list_has_content_length: true,
list_has_etag: true,

shared: true,

Expand Down
4 changes: 4 additions & 0 deletions core/src/services/hdfs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ impl Access for HdfsBackend {
.set_root(&self.root)
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_last_modified: true,

read: true,

Expand All @@ -229,6 +231,8 @@ impl Access for HdfsBackend {
delete: true,

list: true,
list_has_content_length: true,
list_has_last_modified: true,

rename: true,
blocking: true,
Expand Down
2 changes: 2 additions & 0 deletions core/src/services/hdfs_native/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ impl Access for HdfsNativeBackend {
.set_root(&self.root)
.set_native_capability(Capability {
stat: true,
stat_has_last_modified: true,
stat_has_content_length: true,

delete: true,
rename: true,
Expand Down
9 changes: 9 additions & 0 deletions core/src/services/http/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ impl Access for HttpBackend {
stat: true,
stat_with_if_match: true,
stat_with_if_none_match: true,
stat_has_cache_control: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_content_encoding: true,
stat_has_content_range: true,
stat_has_etag: true,
stat_has_content_md5: true,
stat_has_last_modified: true,
stat_has_content_disposition: true,

read: true,

Expand Down
4 changes: 4 additions & 0 deletions core/src/services/huggingface/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,15 @@ impl Access for HuggingfaceBackend {
am.set_scheme(Scheme::Huggingface)
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_last_modified: true,

read: true,

list: true,
list_with_recursive: true,
list_has_content_length: true,
list_has_last_modified: true,

shared: true,

Expand Down
4 changes: 4 additions & 0 deletions core/src/services/icloud/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ impl Access for IcloudBackend {
.set_root(&self.core.root)
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_last_modified: true,

read: true,

shared: true,
..Default::default()
});
Expand Down
4 changes: 4 additions & 0 deletions core/src/services/ipfs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ impl Access for IpfsBackend {
.set_root(&self.root)
.set_native_capability(Capability {
stat: true,
stat_has_content_length: true,
stat_has_content_type: true,
stat_has_etag: true,
stat_has_content_disposition: true,

read: true,

Expand Down
Loading

0 comments on commit 4e99afa

Please sign in to comment.