diff --git a/src/api/admin/api.rs b/src/api/admin/api.rs index 3421b453..c57bab29 100644 --- a/src/api/admin/api.rs +++ b/src/api/admin/api.rs @@ -11,7 +11,7 @@ use garage_model::garage::Garage; use crate::admin::error::Error; use crate::admin::macros::*; -use crate::admin::EndpointHandler; +use crate::admin::RequestHandler; use crate::helpers::is_default; // This generates the following: diff --git a/src/api/admin/api_server.rs b/src/api/admin/api_server.rs index d66714db..f901129b 100644 --- a/src/api/admin/api_server.rs +++ b/src/api/admin/api_server.rs @@ -26,7 +26,7 @@ use crate::admin::error::*; use crate::admin::router_v0; use crate::admin::router_v1; use crate::admin::Authorization; -use crate::admin::EndpointHandler; +use crate::admin::RequestHandler; use crate::helpers::*; pub type ResBody = BoxBody; diff --git a/src/api/admin/bucket.rs b/src/api/admin/bucket.rs index 9ac54892..896d989b 100644 --- a/src/api/admin/bucket.rs +++ b/src/api/admin/bucket.rs @@ -19,11 +19,11 @@ use garage_model::s3::object_table::*; use crate::admin::api::*; use crate::admin::error::*; -use crate::admin::EndpointHandler; +use crate::admin::RequestHandler; use crate::common_error::CommonError; #[async_trait] -impl EndpointHandler for ListBucketsRequest { +impl RequestHandler for ListBucketsRequest { type Response = ListBucketsResponse; async fn handle(self, garage: &Arc) -> Result { @@ -70,7 +70,7 @@ impl EndpointHandler for ListBucketsRequest { } #[async_trait] -impl EndpointHandler for GetBucketInfoRequest { +impl RequestHandler for GetBucketInfoRequest { type Response = GetBucketInfoResponse; async fn handle(self, garage: &Arc) -> Result { @@ -222,7 +222,7 @@ async fn bucket_info_results( } #[async_trait] -impl EndpointHandler for CreateBucketRequest { +impl RequestHandler for CreateBucketRequest { type Response = CreateBucketResponse; async fn handle(self, garage: &Arc) -> Result { @@ -293,7 +293,7 @@ impl EndpointHandler for CreateBucketRequest { } #[async_trait] -impl EndpointHandler for DeleteBucketRequest { +impl RequestHandler for DeleteBucketRequest { type Response = DeleteBucketResponse; async fn handle(self, garage: &Arc) -> Result { @@ -342,7 +342,7 @@ impl EndpointHandler for DeleteBucketRequest { } #[async_trait] -impl EndpointHandler for UpdateBucketRequest { +impl RequestHandler for UpdateBucketRequest { type Response = UpdateBucketResponse; async fn handle(self, garage: &Arc) -> Result { @@ -389,7 +389,7 @@ impl EndpointHandler for UpdateBucketRequest { } #[async_trait] -impl EndpointHandler for CleanupIncompleteUploadsRequest { +impl RequestHandler for CleanupIncompleteUploadsRequest { type Response = CleanupIncompleteUploadsResponse; async fn handle(self, garage: &Arc) -> Result { @@ -411,7 +411,7 @@ impl EndpointHandler for CleanupIncompleteUploadsRequest { // ---- BUCKET/KEY PERMISSIONS ---- #[async_trait] -impl EndpointHandler for AllowBucketKeyRequest { +impl RequestHandler for AllowBucketKeyRequest { type Response = AllowBucketKeyResponse; async fn handle(self, garage: &Arc) -> Result { @@ -421,7 +421,7 @@ impl EndpointHandler for AllowBucketKeyRequest { } #[async_trait] -impl EndpointHandler for DenyBucketKeyRequest { +impl RequestHandler for DenyBucketKeyRequest { type Response = DenyBucketKeyResponse; async fn handle(self, garage: &Arc) -> Result { @@ -470,7 +470,7 @@ pub async fn handle_bucket_change_key_perm( // ---- BUCKET ALIASES ---- #[async_trait] -impl EndpointHandler for AddBucketAliasRequest { +impl RequestHandler for AddBucketAliasRequest { type Response = AddBucketAliasResponse; async fn handle(self, garage: &Arc) -> Result { @@ -501,7 +501,7 @@ impl EndpointHandler for AddBucketAliasRequest { } #[async_trait] -impl EndpointHandler for RemoveBucketAliasRequest { +impl RequestHandler for RemoveBucketAliasRequest { type Response = RemoveBucketAliasResponse; async fn handle(self, garage: &Arc) -> Result { diff --git a/src/api/admin/cluster.rs b/src/api/admin/cluster.rs index 0cfd744a..fd63f177 100644 --- a/src/api/admin/cluster.rs +++ b/src/api/admin/cluster.rs @@ -12,10 +12,10 @@ use garage_model::garage::Garage; use crate::admin::api::*; use crate::admin::error::*; -use crate::admin::EndpointHandler; +use crate::admin::RequestHandler; #[async_trait] -impl EndpointHandler for GetClusterStatusRequest { +impl RequestHandler for GetClusterStatusRequest { type Response = GetClusterStatusResponse; async fn handle(self, garage: &Arc) -> Result { @@ -117,7 +117,7 @@ impl EndpointHandler for GetClusterStatusRequest { } #[async_trait] -impl EndpointHandler for GetClusterHealthRequest { +impl RequestHandler for GetClusterHealthRequest { type Response = GetClusterHealthResponse; async fn handle(self, garage: &Arc) -> Result { @@ -143,7 +143,7 @@ impl EndpointHandler for GetClusterHealthRequest { } #[async_trait] -impl EndpointHandler for ConnectClusterNodesRequest { +impl RequestHandler for ConnectClusterNodesRequest { type Response = ConnectClusterNodesResponse; async fn handle(self, garage: &Arc) -> Result { @@ -166,7 +166,7 @@ impl EndpointHandler for ConnectClusterNodesRequest { } #[async_trait] -impl EndpointHandler for GetClusterLayoutRequest { +impl RequestHandler for GetClusterLayoutRequest { type Response = GetClusterLayoutResponse; async fn handle(self, garage: &Arc) -> Result { @@ -226,7 +226,7 @@ fn format_cluster_layout(layout: &layout::LayoutHistory) -> GetClusterLayoutResp // ---- update functions ---- #[async_trait] -impl EndpointHandler for UpdateClusterLayoutRequest { +impl RequestHandler for UpdateClusterLayoutRequest { type Response = UpdateClusterLayoutResponse; async fn handle(self, garage: &Arc) -> Result { @@ -272,7 +272,7 @@ impl EndpointHandler for UpdateClusterLayoutRequest { } #[async_trait] -impl EndpointHandler for ApplyClusterLayoutRequest { +impl RequestHandler for ApplyClusterLayoutRequest { type Response = ApplyClusterLayoutResponse; async fn handle(self, garage: &Arc) -> Result { @@ -293,7 +293,7 @@ impl EndpointHandler for ApplyClusterLayoutRequest { } #[async_trait] -impl EndpointHandler for RevertClusterLayoutRequest { +impl RequestHandler for RevertClusterLayoutRequest { type Response = RevertClusterLayoutResponse; async fn handle(self, garage: &Arc) -> Result { diff --git a/src/api/admin/key.rs b/src/api/admin/key.rs index d2f449ed..0605cb80 100644 --- a/src/api/admin/key.rs +++ b/src/api/admin/key.rs @@ -10,10 +10,10 @@ use garage_model::key_table::*; use crate::admin::api::*; use crate::admin::error::*; -use crate::admin::EndpointHandler; +use crate::admin::RequestHandler; #[async_trait] -impl EndpointHandler for ListKeysRequest { +impl RequestHandler for ListKeysRequest { type Response = ListKeysResponse; async fn handle(self, garage: &Arc) -> Result { @@ -39,7 +39,7 @@ impl EndpointHandler for ListKeysRequest { } #[async_trait] -impl EndpointHandler for GetKeyInfoRequest { +impl RequestHandler for GetKeyInfoRequest { type Response = GetKeyInfoResponse; async fn handle(self, garage: &Arc) -> Result { @@ -63,7 +63,7 @@ impl EndpointHandler for GetKeyInfoRequest { } #[async_trait] -impl EndpointHandler for CreateKeyRequest { +impl RequestHandler for CreateKeyRequest { type Response = CreateKeyResponse; async fn handle(self, garage: &Arc) -> Result { @@ -77,7 +77,7 @@ impl EndpointHandler for CreateKeyRequest { } #[async_trait] -impl EndpointHandler for ImportKeyRequest { +impl RequestHandler for ImportKeyRequest { type Response = ImportKeyResponse; async fn handle(self, garage: &Arc) -> Result { @@ -101,7 +101,7 @@ impl EndpointHandler for ImportKeyRequest { } #[async_trait] -impl EndpointHandler for UpdateKeyRequest { +impl RequestHandler for UpdateKeyRequest { type Response = UpdateKeyResponse; async fn handle(self, garage: &Arc) -> Result { @@ -132,7 +132,7 @@ impl EndpointHandler for UpdateKeyRequest { } #[async_trait] -impl EndpointHandler for DeleteKeyRequest { +impl RequestHandler for DeleteKeyRequest { type Response = DeleteKeyResponse; async fn handle(self, garage: &Arc) -> Result { diff --git a/src/api/admin/macros.rs b/src/api/admin/macros.rs index 31fffd42..a75f1196 100644 --- a/src/api/admin/macros.rs +++ b/src/api/admin/macros.rs @@ -71,7 +71,7 @@ macro_rules! admin_endpoints { )* #[async_trait] - impl EndpointHandler for AdminApiRequest { + impl RequestHandler for AdminApiRequest { type Response = AdminApiResponse; async fn handle(self, garage: &Arc) -> Result { @@ -137,7 +137,7 @@ macro_rules! local_admin_endpoints { } #[async_trait] - impl EndpointHandler for [< $endpoint Request >] { + impl RequestHandler for [< $endpoint Request >] { type Response = [< $endpoint Response >]; async fn handle(self, garage: &Arc) -> Result { @@ -157,7 +157,7 @@ macro_rules! local_admin_endpoints { } #[async_trait] - impl EndpointHandler for LocalAdminApiRequest { + impl RequestHandler for LocalAdminApiRequest { type Response = LocalAdminApiResponse; async fn handle(self, garage: &Arc) -> Result { diff --git a/src/api/admin/mod.rs b/src/api/admin/mod.rs index 2cdd019e..07c53cb1 100644 --- a/src/api/admin/mod.rs +++ b/src/api/admin/mod.rs @@ -29,7 +29,7 @@ pub enum Authorization { } #[async_trait] -pub trait EndpointHandler { +pub trait RequestHandler { type Response; async fn handle(self, garage: &Arc) -> Result; diff --git a/src/api/admin/rpc.rs b/src/api/admin/rpc.rs index ecdddcee..26de3783 100644 --- a/src/api/admin/rpc.rs +++ b/src/api/admin/rpc.rs @@ -12,7 +12,7 @@ use garage_rpc::*; use garage_model::garage::Garage; use crate::admin::api::{LocalAdminApiRequest, LocalAdminApiResponse}; -use crate::admin::EndpointHandler as AdminApiEndpoint; +use crate::admin::RequestHandler as AdminApiEndpoint; use crate::generic_server::ApiError; pub const ADMIN_RPC_PATH: &str = "garage_api/admin/rpc.rs/Rpc"; diff --git a/src/api/admin/special.rs b/src/api/admin/special.rs index da3764d9..9b900a4e 100644 --- a/src/api/admin/special.rs +++ b/src/api/admin/special.rs @@ -13,11 +13,11 @@ use garage_rpc::system::ClusterHealthStatus; use crate::admin::api::{CheckDomainRequest, HealthRequest, OptionsRequest}; use crate::admin::api_server::ResBody; use crate::admin::error::*; -use crate::admin::EndpointHandler; +use crate::admin::RequestHandler; use crate::helpers::*; #[async_trait] -impl EndpointHandler for OptionsRequest { +impl RequestHandler for OptionsRequest { type Response = Response; async fn handle(self, _garage: &Arc) -> Result, Error> { @@ -32,7 +32,7 @@ impl EndpointHandler for OptionsRequest { } #[async_trait] -impl EndpointHandler for CheckDomainRequest { +impl RequestHandler for CheckDomainRequest { type Response = Response; async fn handle(self, garage: &Arc) -> Result, Error> { @@ -102,7 +102,7 @@ async fn check_domain(garage: &Arc, domain: &str) -> Result } #[async_trait] -impl EndpointHandler for HealthRequest { +impl RequestHandler for HealthRequest { type Response = Response; async fn handle(self, garage: &Arc) -> Result, Error> { diff --git a/src/api/admin/worker.rs b/src/api/admin/worker.rs index 973f35cb..5589f216 100644 --- a/src/api/admin/worker.rs +++ b/src/api/admin/worker.rs @@ -6,10 +6,10 @@ use garage_model::garage::Garage; use crate::admin::api::*; use crate::admin::error::Error; -use crate::admin::EndpointHandler; +use crate::admin::RequestHandler; #[async_trait] -impl EndpointHandler for LocalGetWorkerParamRequest { +impl RequestHandler for LocalGetWorkerParamRequest { type Response = LocalGetWorkerParamResponse; async fn handle(self, garage: &Arc) -> Result { diff --git a/src/garage/admin/mod.rs b/src/garage/admin/mod.rs index 91ab7588..4d704264 100644 --- a/src/garage/admin/mod.rs +++ b/src/garage/admin/mod.rs @@ -27,7 +27,7 @@ use garage_model::s3::mpu_table::MultipartUpload; use garage_model::s3::version_table::Version; use garage_api::admin::api::{AdminApiRequest, TaggedAdminApiResponse}; -use garage_api::admin::EndpointHandler as AdminApiEndpoint; +use garage_api::admin::RequestHandler as AdminApiEndpoint; use garage_api::generic_server::ApiError; use crate::cli::*; diff --git a/src/garage/cli_v2/mod.rs b/src/garage/cli_v2/mod.rs index 692b7c1c..f24dc952 100644 --- a/src/garage/cli_v2/mod.rs +++ b/src/garage/cli_v2/mod.rs @@ -13,7 +13,7 @@ use garage_rpc::system::*; use garage_rpc::*; use garage_api::admin::api::*; -use garage_api::admin::EndpointHandler as AdminApiEndpoint; +use garage_api::admin::RequestHandler as AdminApiEndpoint; use crate::admin::*; use crate::cli as cli_v1;