diff options
Diffstat (limited to 'src/api/admin/lib.rs')
-rw-r--r-- | src/api/admin/lib.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/api/admin/lib.rs b/src/api/admin/lib.rs index 31b3874d..dd9b7ffd 100644 --- a/src/api/admin/lib.rs +++ b/src/api/admin/lib.rs @@ -15,21 +15,29 @@ mod cluster; mod key; mod special; -use std::sync::Arc; +mod block; +mod node; +mod repair; +mod worker; -use async_trait::async_trait; +use std::sync::Arc; use garage_model::garage::Garage; +pub use api_server::AdminApiServer as Admin; + pub enum Authorization { None, MetricsToken, AdminToken, } -#[async_trait] -pub trait EndpointHandler { +pub trait RequestHandler { type Response; - async fn handle(self, garage: &Arc<Garage>) -> Result<Self::Response, error::Error>; + fn handle( + self, + garage: &Arc<Garage>, + admin: &Admin, + ) -> impl std::future::Future<Output = Result<Self::Response, error::Error>> + Send; } |