diff options
Diffstat (limited to 'src/api/admin/lib.rs')
-rw-r--r-- | src/api/admin/lib.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/api/admin/lib.rs b/src/api/admin/lib.rs new file mode 100644 index 00000000..dd9b7ffd --- /dev/null +++ b/src/api/admin/lib.rs @@ -0,0 +1,43 @@ +#[macro_use] +extern crate tracing; + +pub mod api_server; +mod error; +mod macros; + +pub mod api; +mod router_v0; +mod router_v1; +mod router_v2; + +mod bucket; +mod cluster; +mod key; +mod special; + +mod block; +mod node; +mod repair; +mod worker; + +use std::sync::Arc; + +use garage_model::garage::Garage; + +pub use api_server::AdminApiServer as Admin; + +pub enum Authorization { + None, + MetricsToken, + AdminToken, +} + +pub trait RequestHandler { + type Response; + + fn handle( + self, + garage: &Arc<Garage>, + admin: &Admin, + ) -> impl std::future::Future<Output = Result<Self::Response, error::Error>> + Send; +} |