diff options
author | Alex <alex@adnab.me> | 2024-03-04 14:51:05 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2024-03-04 14:51:05 +0000 |
commit | 3168bb34a0082480660e945f7390a5ecab26c665 (patch) | |
tree | 2b9d53b65c41f074b772c2123f0a27893e33859a /src/api/k2v/index.rs | |
parent | 512933a036be97ab01b8b2627b727d599b962715 (diff) | |
parent | fb55682c66092921f766f82c16eb9e046f1bbb41 (diff) | |
download | garage-3168bb34a0082480660e945f7390a5ecab26c665.tar.gz garage-3168bb34a0082480660e945f7390a5ecab26c665.zip |
Merge pull request 'add request context helper' (#751) from yuka/garage:req-ctx into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/751
Diffstat (limited to 'src/api/k2v/index.rs')
-rw-r--r-- | src/api/k2v/index.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/api/k2v/index.rs b/src/api/k2v/index.rs index 1baec1db..822bec44 100644 --- a/src/api/k2v/index.rs +++ b/src/api/k2v/index.rs @@ -3,12 +3,9 @@ use std::sync::Arc; use hyper::Response; use serde::Serialize; -use garage_util::data::*; - use garage_rpc::ring::Ring; use garage_table::util::*; -use garage_model::garage::Garage; use garage_model::k2v::item_table::{BYTES, CONFLICTS, ENTRIES, VALUES}; use crate::helpers::*; @@ -17,14 +14,17 @@ use crate::k2v::error::*; use crate::k2v::range::read_range; pub async fn handle_read_index( - garage: Arc<Garage>, - bucket_id: Uuid, + ctx: ReqCtx, prefix: Option<String>, start: Option<String>, end: Option<String>, limit: Option<u64>, reverse: Option<bool>, ) -> Result<Response<ResBody>, Error> { + let ReqCtx { + garage, bucket_id, .. + } = &ctx; + let reverse = reverse.unwrap_or(false); let ring: Arc<Ring> = garage.system.ring.borrow().clone(); |