-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Implement list with deleted for s3 service
Signed-off-by: Xuanwo <[email protected]>
- Loading branch information
Showing
7 changed files
with
167 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -612,7 +612,6 @@ impl S3Core { | |
write!(url, "&max-keys={limit}").expect("write into string must succeed"); | ||
} | ||
if let Some(start_after) = start_after { | ||
let start_after = build_abs_path(&self.root, &start_after); | ||
write!(url, "&start-after={}", percent_encode_path(&start_after)) | ||
.expect("write into string must succeed"); | ||
} | ||
|
@@ -994,6 +993,7 @@ pub struct ListObjectVersionsOutput { | |
pub next_version_id_marker: Option<String>, | ||
pub common_prefixes: Vec<OutputCommonPrefix>, | ||
pub version: Vec<ListObjectVersionsOutputVersion>, | ||
pub delete_marker: Vec<ListObjectVersionsOutputDeleteMarker>, | ||
} | ||
|
||
#[derive(Default, Debug, Eq, PartialEq, Deserialize)] | ||
|
@@ -1008,6 +1008,15 @@ pub struct ListObjectVersionsOutputVersion { | |
pub etag: Option<String>, | ||
} | ||
|
||
#[derive(Default, Debug, Eq, PartialEq, Deserialize)] | ||
#[serde(rename_all = "PascalCase")] | ||
pub struct ListObjectVersionsOutputDeleteMarker { | ||
pub key: String, | ||
pub version_id: String, | ||
pub is_latest: bool, | ||
pub last_modified: String, | ||
} | ||
|
||
pub enum ChecksumAlgorithm { | ||
Crc32c, | ||
} | ||
|
@@ -1284,6 +1293,16 @@ mod tests { | |
<CommonPrefixes> | ||
<Prefix>videos/</Prefix> | ||
</CommonPrefixes> | ||
<DeleteMarker> | ||
<Key>my-third-image.jpg</Key> | ||
<VersionId>03jpff543dhffds434rfdsFDN943fdsFkdmqnh892</VersionId> | ||
<IsLatest>true</IsLatest> | ||
<LastModified>2009-10-15T17:50:30.000Z</LastModified> | ||
<Owner> | ||
<ID>75aa57f09aa0c8caeab4f8c24e99d10f8e7faeebf76c078efc7c6caea54ba06a</ID> | ||
<DisplayName>[email protected]</DisplayName> | ||
</Owner> | ||
</DeleteMarker> | ||
</ListVersionsResult>"#, | ||
); | ||
|
||
|
@@ -1329,5 +1348,15 @@ mod tests { | |
} | ||
] | ||
); | ||
|
||
assert_eq!( | ||
output.delete_marker, | ||
vec![ListObjectVersionsOutputDeleteMarker { | ||
key: "my-third-image.jpg".to_owned(), | ||
version_id: "03jpff543dhffds434rfdsFDN943fdsFkdmqnh892".to_owned(), | ||
is_latest: true, | ||
last_modified: "2009-10-15T17:50:30.000Z".to_owned(), | ||
},] | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.