From 89ff9f5576f91dc127ba3cc1fae96543e27b9468 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 30 Jan 2025 19:08:48 +0100 Subject: 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 --- src/api/admin/lib.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/api/admin/lib.rs') 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) -> Result; + async fn handle( + self, + garage: &Arc, + admin: &Admin, + ) -> Result; } -- cgit v1.2.3