diff options
author | Alex <lx@deuxfleurs.fr> | 2025-02-01 17:48:25 +0000 |
---|---|---|
committer | Alex <lx@deuxfleurs.fr> | 2025-02-01 17:48:25 +0000 |
commit | d601f311865b8159a7bf1801dd8f43021d0b443b (patch) | |
tree | 07e4268d09a6bead4c4e5a2a4f122471a7a5d23b /src/web | |
parent | 9330fd79d3466051394f6d419a247d46da8f5151 (diff) | |
parent | e4de7bdfd5e6acc05309f59d7f77755f0807e8e4 (diff) | |
download | garage-d601f311865b8159a7bf1801dd8f43021d0b443b.tar.gz garage-d601f311865b8159a7bf1801dd8f43021d0b443b.zip |
Merge pull request 'split garage_api in garage_api_{common,s3,k2v,admin}' (#947) from split-garage-api into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/947
Diffstat (limited to 'src/web')
-rw-r--r-- | src/web/Cargo.toml | 6 | ||||
-rw-r--r-- | src/web/error.rs | 8 | ||||
-rw-r--r-- | src/web/web_server.rs | 12 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/web/Cargo.toml b/src/web/Cargo.toml index d810d6f9..a0a3e566 100644 --- a/src/web/Cargo.toml +++ b/src/web/Cargo.toml @@ -14,7 +14,8 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -garage_api.workspace = true +garage_api_common.workspace = true +garage_api_s3.workspace = true garage_model.workspace = true garage_util.workspace = true garage_table.workspace = true @@ -23,12 +24,9 @@ err-derive.workspace = true tracing.workspace = true percent-encoding.workspace = true -futures.workspace = true - http.workspace = true http-body-util.workspace = true hyper.workspace = true -hyper-util.workspace = true tokio.workspace = true diff --git a/src/web/error.rs b/src/web/error.rs index bd8f17b5..7e6d4542 100644 --- a/src/web/error.rs +++ b/src/web/error.rs @@ -2,14 +2,14 @@ use err_derive::Error; use hyper::header::HeaderValue; use hyper::{HeaderMap, StatusCode}; -use garage_api::generic_server::ApiError; +use garage_api_common::generic_server::ApiError; /// Errors of this crate #[derive(Debug, Error)] pub enum Error { /// An error received from the API crate #[error(display = "API error: {}", _0)] - ApiError(garage_api::s3::error::Error), + ApiError(garage_api_s3::error::Error), /// The file does not exist #[error(display = "Not found")] @@ -22,10 +22,10 @@ pub enum Error { impl<T> From<T> for Error where - garage_api::s3::error::Error: From<T>, + garage_api_s3::error::Error: From<T>, { fn from(err: T) -> Self { - Error::ApiError(garage_api::s3::error::Error::from(err)) + Error::ApiError(garage_api_s3::error::Error::from(err)) } } diff --git a/src/web/web_server.rs b/src/web/web_server.rs index 69939f65..48dcb5b1 100644 --- a/src/web/web_server.rs +++ b/src/web/web_server.rs @@ -20,13 +20,15 @@ use opentelemetry::{ use crate::error::*; -use garage_api::generic_server::{server_loop, UnixListenerOn}; -use garage_api::helpers::*; -use garage_api::s3::cors::{add_cors_headers, find_matching_cors_rule, handle_options_for_bucket}; -use garage_api::s3::error::{ +use garage_api_common::cors::{ + add_cors_headers, find_matching_cors_rule, handle_options_for_bucket, +}; +use garage_api_common::generic_server::{server_loop, UnixListenerOn}; +use garage_api_common::helpers::*; +use garage_api_s3::error::{ CommonErrorDerivative, Error as ApiError, OkOrBadRequest, OkOrInternalError, }; -use garage_api::s3::get::{handle_get_without_ctx, handle_head_without_ctx}; +use garage_api_s3::get::{handle_get_without_ctx, handle_head_without_ctx}; use garage_model::garage::Garage; |