diff options
author | Alex Auvolat <lx@deuxfleurs.fr> | 2025-01-30 19:08:48 +0100 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-03 18:54:51 +0100 |
commit | 89ff9f5576f91dc127ba3cc1fae96543e27b9468 (patch) | |
tree | dd6f849031b7ba78a6ca06005918e93bcf3de320 /src/api/admin/lib.rs | |
parent | bdaf55ab3f866234bd5a7d585758265a88d2906a (diff) | |
download | garage-89ff9f5576f91dc127ba3cc1fae96543e27b9468.tar.gz garage-89ff9f5576f91dc127ba3cc1fae96543e27b9468.zip |
admin api: base infrastructure for local endpoints
admin api: rename EndpointHandler into RequestHandler to avoid confusion with RPC
wip: infrastructure for local api calls
admin api: fix things
admin api: first local endpoint to work with new scheme
admin api: implement SetWorkerVariable
Diffstat (limited to 'src/api/admin/lib.rs')
-rw-r--r-- | src/api/admin/lib.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/api/admin/lib.rs b/src/api/admin/lib.rs index 31b3874d..4ad10532 100644 --- a/src/api/admin/lib.rs +++ b/src/api/admin/lib.rs @@ -15,12 +15,16 @@ mod cluster; mod key; mod special; +mod worker; + use std::sync::Arc; use async_trait::async_trait; use garage_model::garage::Garage; +pub use api_server::AdminApiServer as Admin; + pub enum Authorization { None, MetricsToken, @@ -28,8 +32,12 @@ pub enum Authorization { } #[async_trait] -pub trait EndpointHandler { +pub trait RequestHandler { type Response; - async fn handle(self, garage: &Arc<Garage>) -> Result<Self::Response, error::Error>; + async fn handle( + self, + garage: &Arc<Garage>, + admin: &Admin, + ) -> Result<Self::Response, error::Error>; } |