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

implement other S3 API #18

Merged
merged 1 commit into from
Jan 16, 2025
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
2 changes: 1 addition & 1 deletion src/cas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod bucket_meta;
mod buffered_byte_stream;
mod errors;
mod fs;
mod multipart;
pub mod multipart;
pub mod object;
pub mod range_request;

Expand Down
5 changes: 3 additions & 2 deletions src/cas/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const MULTIPART_TREE: &str = "_MULTIPART_PARTS";
pub const PTR_SIZE: usize = mem::size_of::<usize>(); // Size of a `usize` in bytes
const MAX_KEYS: i64 = 1000;

#[derive(Debug)]
pub struct CasFS {
db: Db,
root: PathBuf,
Expand Down Expand Up @@ -122,7 +123,7 @@ impl CasFS {
}

/// Open the tree containing the multipart parts.
fn multipart_tree(&self) -> Result<sled::Tree, sled::Error> {
pub fn multipart_tree(&self) -> Result<sled::Tree, sled::Error> {
self.db.open_tree(MULTIPART_TREE)
}

Expand Down Expand Up @@ -249,7 +250,7 @@ impl CasFS {
}

/// Get a list of all buckets in the system.
fn buckets(&self) -> Result<Vec<Bucket>, sled::Error> {
pub fn buckets(&self) -> Result<Vec<Bucket>, sled::Error> {
Ok(self
.bucket_meta_tree()?
.scan_prefix(&[])
Expand Down
4 changes: 2 additions & 2 deletions src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const S3_API_METHODS: &[&str] = &[
"upload_part",
];

#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct SharedMetrics {
metrics: Arc<Metrics>,
}
Expand All @@ -51,7 +51,7 @@ impl Deref for SharedMetrics {
&self.metrics
}
}

#[derive(Debug)]
pub struct Metrics {
method_calls: IntCounterVec,
bucket_count: IntGauge,
Expand Down
Loading
Loading