Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3object meta #669

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/esthri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,13 @@ async fn list_objects_request(
for object in contents {
match (object.key, object.e_tag) {
(Some(key), Some(e_tag)) => {
listing.contents.push(S3Object { key, e_tag });
listing.contents.push(S3Object {
key,
e_tag,
storage_class: object.storage_class,
size: object.size,
last_modified: object.last_modified,
});
}
(key, etag) => {
if key.is_none() {
Expand Down
6 changes: 6 additions & 0 deletions crates/esthri/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ use std::{
result::Result as StdResult,
};

use aws_sdk_s3::primitives::DateTime;
use aws_sdk_s3::types::ObjectStorageClass;
use regex::Regex;
use serde::{Deserialize, Deserializer, Serialize, Serializer};

Expand Down Expand Up @@ -149,9 +151,13 @@ impl S3Listing {
}

#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct S3Object {
pub key: String,
pub e_tag: String,
pub storage_class: Option<ObjectStorageClass>,
pub size: Option<i64>,
pub last_modified: Option<DateTime>,
}

/// For syncing from remote to local, or local to remote, "metadata" is attached to the listing in
Expand Down
Loading