aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/s3_list.rs')
-rw-r--r--src/api/s3_list.rs28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs
index a4de388d..df9c3e6b 100644
--- a/src/api/s3_list.rs
+++ b/src/api/s3_list.rs
@@ -1,4 +1,4 @@
-use std::collections::{BTreeMap, BTreeSet, HashMap};
+use std::collections::{BTreeMap, BTreeSet};
use std::sync::Arc;
use hyper::{Body, Response};
@@ -35,32 +35,6 @@ struct ListResultInfo {
etag: String,
}
-pub fn parse_list_objects_query(
- bucket: &str,
- params: &HashMap<String, String>,
-) -> Result<ListObjectsQuery, Error> {
- Ok(ListObjectsQuery {
- is_v2: params.get("list-type").map(|x| x == "2").unwrap_or(false),
- bucket: bucket.to_string(),
- delimiter: params.get("delimiter").filter(|x| !x.is_empty()).cloned(),
- max_keys: params
- .get("max-keys")
- .map(|x| {
- x.parse::<usize>()
- .ok_or_bad_request("Invalid value for max-keys")
- })
- .unwrap_or(Ok(1000))?,
- prefix: params.get("prefix").cloned().unwrap_or_default(),
- marker: params.get("marker").cloned(),
- continuation_token: params.get("continuation-token").cloned(),
- start_after: params.get("start-after").cloned(),
- urlencode_resp: params
- .get("encoding-type")
- .map(|x| x == "url")
- .unwrap_or(false),
- })
-}
-
pub async fn handle_list(
garage: Arc<Garage>,
query: &ListObjectsQuery,